×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Dec 2005
    Location
    Albacete, Spain
    Posts
    380

    Set orientation for flash lite apps

    I have an SWF designed to be run in landscape in N97 devices.
    I launch it using the C++ stub in http://wiki.forum.nokia.com/index.ph...th_Carbide.c++

    Is it possible to set the orientation using this stub?, so the app is launch in landscape and does not get in portrait mode if the handset is oriented in portrait.

    If not, can can someone point to a piece of code (prefereable in C++) that can launch an SWF in landscape?
    ----------------------------------------------
    Every journey starts with a small step.

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

    Re: Set orientation for flash lite apps

    Hi juannoguera,
    Few months back i also thought the same and did number of experiments and here are my conclusions :
    - One can use SetOrientationL API to lock the orientation in Symbian C++ applications but the same API if used in a SWF Launcher does nothing. It actually locks the orientation but as soon as Flash Lite Player loads , it resets the lock. So, according to my observation, one cannot lock orientation to landscape/portrait using native Symbian C++ APIs in Flash lite stub. One of a related discussion thread is here :
    Embedded-Flash-Lite-amp-App-Orientation
    - Flash Lite 3.1 provides DisableAutoRotation API to lock the orientation but it actually locks your application to the orientation in which it is launched. Therefore, neither it helps u to lock the orientation to either landscape or portrait only.
    - One of a solution that will work is combination of DeviceLock & rotation of screen. Discussed here (See post # 11):
    hSetting-the-default-orientation-for-flash-app&highlight=lock
    - However, it is not a big issue for end-users , you can just show a notification to user "Please, change orientation to get full screen" and it works. Just see famous BreakDesign games in OVI Store for an overview.

    Best Regards,
    SajiSoft

  3. #3
    Registered User
    Join Date
    Dec 2005
    Location
    Albacete, Spain
    Posts
    380

    Re: Set orientation for flash lite apps

    thanks a lot SajiSoft.

    I read http://wiki.forum.nokia.com/index.ph...e_applications
    and I was afraid that it was not possible.
    I figured out that if the Flash app was launched from Symbian C++ code, there could be a way to lock to a certain orientation. But I haven't found how in C++.
    So I was wondering if there was an "actionscript" (native flash) way. I will try the ways mentioned in your links.
    ----------------------------------------------
    Every journey starts with a small step.

  4. #4
    Registered User
    Join Date
    Apr 2010
    Posts
    44

    Re: Set orientation for flash lite apps

    I have made a lot of testing with this problem and here is some code that locks the screen into one position. On loading the app, detect the rotation and rotate back. Also lock the flash position=disable rotate sensor.



    Put code inside selfevent load.
    Code:
    import com.nokia.lib.Service;
    var sensors = new Service("Service.Sensor", "ISensor");
    fscommand2("DisableKeypadCompatibilityMode");
    fscommand2("FullScreen", true );
    
    import com.nokia.lib.Device;
    var deviceObject:Object = new Device();
    deviceObject.DisableAutoRotation(true);
    
    
    
    
    Stage.scaleMode = "noScale"; 
    Stage.align = "TL";

    Then it's good to make some waiting time for app to gain full screen (without the buttons) and run code:

    Code:
    _global.widthh=Stage.width;
    _global.heighth=Stage.height;
    if(_global.widthh > _global.heighth )
    {
    this._width=220;
    this._height=270;
    this._rotation = 270; 
    this._x = 0; 
    this._y = 230;  
    }

    There might be multiple errors in that code..
    Last edited by juhauta; 2010-10-07 at 17:39.

Similar Threads

  1. Embedded Flash Lite & App Orientation
    By EagleSW in forum [Archived] Flash Lite on Nokia Devices
    Replies: 9
    Last Post: 2010-04-24, 11:25
  2. Orientation WRT vs Flash Lite
    By Doccie in forum [Archived] Flash Lite on Nokia Devices
    Replies: 2
    Last Post: 2009-07-10, 15:32
  3. flash lite sample apps
    By paooolino in forum General Development Questions
    Replies: 1
    Last Post: 2009-03-07, 21:02
  4. 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
  5. Minimizing apps in Flash lite
    By manikantan in forum [Archived] Flash Lite on Nokia Devices
    Replies: 5
    Last Post: 2008-04-21, 16:54

Posting Permissions

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