×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    5

    Problems with embedding an .swf in a widget - soft buttons appearing for no reason

    I'm making a little flash game for Nokia 5800 that I'm planning to release as a widget. I've tried the methods to package the flash content described here:
    http://wiki.forum.nokia.com/index.ph...nt_in_a_Widget

    Currently I have the flash embedded in the HTML as this enables me to lock the screen orientation to Landscape mode with Javascript. The soft buttons have been hidden in the widget as the game is meant to fill the whole screen. It works reasonably well BUT when you click the flash area for the first time it seems to get focused/activated or something causing two soft buttons (Done/Cancel) to appear in the widget. They have no function and they disappear when either of them is clicked. (The instructions in the above mentioned tutorial seem a bit off as it seems only the <embed> part of the code is needed.) Any ideas what could cause this?

    Also when the flash is embedded inside a widget it develops a slight delay in recognizing the touch. I have created a mouse listener that displays a 'pointer' when screen is touched and hides it again the finger is lifted and this is where the delay shows - it takes a moment for the pointer to appear and it stays visible a fraction too long. When running the .swf directly in the flash player both of these happen instantly. Any cure for this?

    In short - I'm looking for the best way to display a fullscreen flash in a widget and to be able to control the Portrait/Horizontal rotation. Anyone have any 'Best Practices' for these?

    -markus

  2. #2
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Problems with embedding an .swf in a widget - soft buttons appearing for no reaso

    Just a question which may help u:
    Do u Put this in the first frame of ur flash file ?
    Code:
    FSCommand2("fullscreen", "true");
    FSCommand2("setSoftKeys", "Select","Previous");
    FSCommand2("setSoftKeys", "", "");
    And use the javascript given over here?
    Controlling SoftKeys in WRT
    i.e
    Code:
    window.menu.hideSoftkeys();
    Hope it helps u...

    Best Regards,
    SajiSoft

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    5

    Re: Problems with embedding an .swf in a widget - soft buttons appearing for no reaso

    Quote Originally Posted by sajisoft View Post
    Just a question which may help u:
    Do u Put this in the first frame of ur flash file ?
    Code:
    FSCommand2("fullscreen", "true");
    FSCommand2("setSoftKeys", "Select","Previous"); (isn't this part redundant?)
    FSCommand2("setSoftKeys", "", "");
    And use the javascript given over here?
    Controlling SoftKeys in WRT
    i.e
    Code:
    window.menu.hideSoftkeys();
    Hope it helps u...

    Best Regards,
    SajiSoft
    Thank You for the reply I checked and I have all the codes in place just like you suggested and the soft keys are hidden like they should when you open the widget - just like before. But the weird thing happens when you touch the screen/flash the first time - that's when buttons appear. The buttons disappear if I click either of them (Done/Cancel) and won't come back until you lock the screen or drop the widget to the background - then when you unlock the screen / come back to the widget the buttons appear again when I touch the screen for the first time. Nothing seems to fix that.

    And is the <meta refresh> -method supposed to work on the Nokia 5800? I tried that as well but it never loads the .swf file.

  4. #4
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Problems with embedding an .swf in a widget - soft buttons appearing for no reaso

    It seems to me a widget issue or may be a bug then. Actually, i m out of country & doesnt have widget compatible phone here. Thus hard to test it 4 u (Sorry). But reading ur previous post again, i feel that u r using widget only because it ables u to lock the orientation.What if we talk about an alternative?
    U can disable the auto orientation by this trick in standalone swf :
    Disable Auto Screen Rotation in 5800
    Ofcourse, u may have to know about this platform api in FLash lite :
    Using Sensor In Flash Lite
    & after that it is quite easy to package ur swf file using swfpack.com into a sis...& now ur flash runs with the same speed in the native symbian c++ stub as it was running in the flash player on the phone. Hope it helps u..

    Best Regards,
    SajiSoft

  5. #5
    Registered User
    Join Date
    Dec 2008
    Posts
    5

    Re: Problems with embedding an .swf in a widget - soft buttons appearing for no reaso

    Well it's starting to look like a bug in the widget system on the 5800. I had a friend try it on a N97 and it works just fine there.

    I had already tried both of the methods you suggested - but none of them are viable in this case. The game does a lot of physics calculation and when I made a version that rotated automatically I also had to add more calculation to compensate for the changed x and y coordinates and this in turn caused a serious drop in frame rate. I may still use this method to detect phone rotation and trigger a pause in the game while displaying an info window informing the user to tilt the phone back to landscape mode.

    As for packing the .swf into a .sis - I've already tried that. And the game runs beautifully as such. But then there is the whole signing process horror that's a bit of an obstacle for a private developer like me. I'm dreaming of Nokia making a web service that allows me to simply upload my .swf file and converts it to a .sis AND(!!) automatically creates keys and certificates and signs the .sis with them - maybe for a fixed fee. Just create a Nokia developer account and the system takes care of the rest. Same kind of webservice would be nice for DRMing the widgets. It shouldn't be too difficult and it would surely create a lot of buzz among developers. Current process is very engineer/programmer oriented but there's a lot of great ideas cooking in the heads of 'lower level' developers with a background in somewhere else than C++ or symbian. Not much point in having a platform where it's easy to develop apps and games using HTML/Javascript/Flash when there's always some bottleneck waiting at the end of the process. So for now I guess I'll try to live with the widgets.

  6. #6
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Problems with embedding an .swf in a widget - soft buttons appearing for no reaso

    Quote Originally Posted by supermurmeli View Post
    I'm dreaming of Nokia making a web service that allows me to simply upload my .swf file and converts it to a .sis AND(!!) automatically creates keys and certificates and signs the .sis with them - maybe for a fixed fee.
    I think such a web service is already on net. U can try :
    http://www.swfpack.com/fn/index.php
    It only takes a(or number of) swf files & few information from u (like name of application ,icon etc) and AUTOMATICALLY generate a self signed SIS .So simple , isnt it. Hope it helps u..

    Best Regards,
    SajiSoft

  7. #7
    Registered User
    Join Date
    Dec 2008
    Posts
    5

    Re: Problems with embedding an .swf in a widget - soft buttons appearing for no reaso

    Quote Originally Posted by sajisoft View Post
    I think such a web service is already on net. U can try :
    http://www.swfpack.com/fn/index.php
    It only takes a(or number of) swf files & few information from u (like name of application ,icon etc) and AUTOMATICALLY generate a self signed SIS .So simple , isnt it. Hope it helps u..

    Best Regards,
    SajiSoft
    Yes yes. I'm aware of the service and I've also tried it . The process is simple and automated indeed when creating a _self_signed_ SIS. I'm talking about Nokia taking the next step and allowing me to create Express Signed (or otherwise commercially viable) SIS files with AUTOMATICALLY generated keys and so on. How simple it would be for a basic developer to create an account for the service, pay some fixed fee and have the service take care of the rest and serve you with a commercially signed SIS that you could submit to the Ovi Store or sell / give away otherwise? Waiting for that day...

Similar Threads

  1. J2ME MIDP2 soft buttons
    By arikoivisto in forum Mobile Java Tools & SDKs
    Replies: 7
    Last Post: 2008-12-01, 18:22
  2. Problems about maemo 4.0.1 SDK installation.
    By fgg_maemo in forum General Development Questions
    Replies: 3
    Last Post: 2008-10-07, 14:26

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×