Contents |
This code snippet demonstrates how to avoid auto rotation of Flash Lite content on Nokia 5800 XpressMusic for Flash Lite 3.x supported from S60 5th Edition onwards. Enclosed in this article you will find a zip file containing all source code used in this article.
fscommand2("DisableKeypadCompatibilityMode");
fscommand2("FullScreen", "true");
Stage.scaleMode = "noScale";
import com.i2tecnologia.base.UIBase;
var base:UIBase = new UIBase(mcBase);
import com.i2tecnologia.utils.*;
class com.i2tecnologia.base.UIBase
{
private var stageSizeListener:Object = new Object();
private var mainMovie:MovieClip;
public function UIBase(aMain:MovieClip)
{
this.mainMovie = aMain;
this.stageSizeListener.onResize = Delegate.create(this, onAutoOrientation);
Stage.addListener(this.stageSizeListener);
}
private function onAutoOrientation():Void
{
if(Stage.width > Stage.height)
{
this.mainMovie._rotation = -90;
this.mainMovie._x = -140;
this.mainMovie._y = 500;
} else {
this.mainMovie._rotation = 0;
this.mainMovie._x = 0;
this.mainMovie._y = 0;
}
}
}
You can update your Flash Lite version to 3.1 on Nokia 5800 by using App. Update. The following code can be used to disable auto rotation on Nokia 5800 in 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);
The sample shown in this article is available for download here: Media:Disable_rotation_flashlite.zip
--Felipe Andrade 15:04, 19 June 2009 (EEST)
No related wiki articles found