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
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?
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
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.
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.
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
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 :
How_to_switch_orientations_in_WRT_Widgetwindow.widget.setDisplayPortrait(); //or
widget.setDisplayLandscape();
Wish u luck
Best Regards,
SajiSoft