Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.
Archived Talk:How to make a Flash Lite application running in any screen orientation
I think it's better to use the width/height ratio instead of the exact pixel size. If not for any other reason, then to avoid rewriting the code for every resolution there might be ;o)
if (Stage.width / Stage.height < 1)
it does not work on my N95
I tried this code on my N95 but it doesn't work properly: it doesn't switch from a resolution to another if I change the resolution using the sliding keyboard. I also tried the example files :( Could anyone help me, please? thanks Antonio
The thing is, the screen capabilities are always set to portrait. I'm working on a workaround myself...
a dirty solution
I solved this issue using a dirty solution: I put the function inside a setInterval function (with 100 as interval value). Basically it continuously checks the orientation value and then switch from a movieclip to another one.
I hope it can help...
Since as I mentioned earlier you always get the same orientation (tried it myself as well ;o)
My idea for the same will be like
Take a variable which maintain current status of application
I mean to say,
Initially application will start with noScale mode.
Stage.scaleMode = "noScale";
So that you can get proper height and width of screen due to fullScreen mode.
then after change Stage mode to normal mode means
Stage.scaleMode = "exactFit";
Using this you can code your elements and height as well width ratio.
For initial loading this thing will enough, I think :).
You have to place a timer where mentioned function will return Stage height and width,
Using same, changing mode.
We can’t handle stage resize event because that event will work only in noScale stage scale mode.
Retrieved from Flash Lite : Auto resize Flash Lite application