×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    8

    How to disable auto orientation in Flash Lite 4 of N8?

    How to disable auto orientation in Flash Lite 4 of N8?

  2. #2
    Registered User
    Join Date
    Apr 2009
    Location
    Hagenberg, Austria
    Posts
    45

    Re: How to disable auto orientation in Flash Lite 4 of N8?

    hi yeggo,

    i was not able to give it a try till now in FL4 but maybe this article can help you:
    http://wiki.forum.nokia.com/index.ph..._on_Nokia_5800


    BR

  3. #3
    Registered User
    Join Date
    Nov 2010
    Posts
    8

    Re: How to disable auto orientation in Flash Lite 4 of N8?

    Thank you for your sharing!

    And I found this code for Flash Lite 3.1:

    fscommand2("DisableKeypadCompatibilityMode");
    fscommand2("FullScreen", "true");

    Stage.scaleMode = "noScale";

    import com.nokia.lib.Device;

    var deviceObject:Object = new Device();
    deviceObject.DisableAutoRotation(true);

    But is there a Flash Lite 4.0 version? Where can I find the NOKIA API for Flash Lite 4.0?

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2006
    Location
    Mumbai, India
    Posts
    48

    Re: How to disable auto orientation in Flash Lite 4 of N8?

    Flash Lite 4.0 supports Actionscript 3.0 and is based on Flash Player 10. There is no separate API specific to the version. You can read more about FL 4 on this link http://wiki.forum.nokia.com/index.ph...an%5E3_devices

    Regarding the auto-rotation disabling code, what you've mentioned will work fine on the N8 even if you compile your program with FL 3.

    fscommand2("fullscreen", "true");
    fscommand2("DisableKeypadCompatibilityMode");
    Stage.scaleMode = "noScale";
    Stage.align = "TL";

    import com.nokia.lib.Device;

    var deviceObject:Object = new Device();
    deviceObject.DisableAutoRotation(true);

    Mariam
    Mariam Dholkawala
    http://www.igamestudio.com

    Blog - http://www.mariamdholkawala.com/mobile
    MaD UG - http://www.indimadgroup.com

  5. #5
    Registered User
    Join Date
    Nov 2010
    Posts
    8

    Re: How to disable auto orientation in Flash Lite 4 of N8?

    Thank you for your advice.

    However I want to use AS 3, so that I cannot use that disabling code.

    I found that the following code works in AS3:

    public function Main()
    {
    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.addEventListener(Event.RESIZE, onResize);
    }

    private function onResize(e:Event):void
    {
    if (stage.stageWidth > stage.stageHeight)
    {
    rotation = -90;
    x = -140;
    y = 500;
    }
    else
    {
    rotation = 0;
    x = 0;
    y = 0;
    }
    }

    But there is still a blink when I rotate the phone, not a perfect solution.

  6. #6
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    112

    Re: How to disable auto orientation in Flash Lite 4 of N8?

    The blink is inevitable using that method, and it's the only way I'm aware of. From my experience it is not a problem as far as OVI test criteria are concerned. I've seen Flash games with it, because it is the only way for FL below 3.1 version (many S60 5th edition devices come with FL 3.0).

    As for:
    deviceObject.DisableAutoRotation(true)

    I don't know any AS3 equivalent. Shame, it's kind of going backwards, let's hope there'll be a similar lib to do that in the future.
    Last edited by RomanAge; 2010-11-11 at 17:20.

  7. #7
    Registered User
    Join Date
    May 2009
    Location
    Nairobi, Kenya
    Posts
    42

    Re: How to disable auto orientation in Flash Lite 4 of N8?

    Don't know about FL4 on N8 but I set landscape or portrait modes as default and without auto orientation via the WGZ route on applications I write for touch screens.

    In the main.html file I set dimensions to 360 by 640 and do the same with the general.css file in the style folder. This seems to force portrait - I have tried the opposite (640 by 360) and it forced the application to run in landscape mode; both times without auto orientation.

    Regards

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

    Re: How to disable auto orientation in Flash Lite 4 of N8?

    Hi,
    Little bit disappointed after reading this thread that we don't even have a lock orientation basic feature in Flash Lite 4 (via AS 3). Hope it will be implemented in future. For now, we can use either rotation (which is not perfect in all cases) or just show a popup showing that please, rotate your device for full screen. Moreover, as Seth Muriithi already discussed that we can use wgz for locking the orientation which is actually done by calling javascript :
    window.widget.setDisplayPortrait(); //or
    widget.setDisplayLandscape();
    How_to_switch_orientations_in_WRT_Widget
    Wish u luck

    Best Regards,
    SajiSoft

Similar Threads

  1. The performance of Flash Lite 4 in N8
    By yeggo in forum [Archived] Flash Lite on Nokia Devices
    Replies: 12
    Last Post: 2011-04-04, 18:02
  2. Disabling the context menu in Flash Lite 4 of N8
    By yeggo in forum [Archived] Flash Lite on Nokia Devices
    Replies: 0
    Last Post: 2010-11-06, 01:32
  3. Set orientation for flash lite apps
    By juannoguera in forum [Archived] Flash Lite on Nokia Devices
    Replies: 3
    Last Post: 2010-10-07, 17:28
  4. Orientation WRT vs Flash Lite
    By Doccie in forum [Archived] Flash Lite on Nokia Devices
    Replies: 2
    Last Post: 2009-07-10, 15:32
  5. Flash Lite orientation after video playback
    By gregmurphy in forum [Archived] Flash Lite on Nokia Devices
    Replies: 6
    Last Post: 2009-03-05, 14:57

Posting Permissions

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