×
Namespaces

Variants
Actions
Revision as of 06:02, 14 May 2013 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Archived:How to avoid auto rotation of Flash Lite content on Nokia 5800

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

We do not recommend Flash Lite development on current Nokia devices, and all Flash Lite articles on this wiki have been archived. Flash Lite has been removed from all Nokia Asha and recent Series 40 devices and has limited support on Symbian. Specific information for Nokia Belle is available in Flash Lite on Nokia Browser for Symbian. Specific information for OLD Series 40 and Symbian devices is available in the Flash Lite Developers Library.

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.

Article Metadata
Code ExampleCompatibility
Platform(s):
S60 5th Edition
Article
Created: felipebzr (19 Jun 2009)
Last edited: hamishwillee (14 May 2013)
Device orientation

Contents

Pros and cons

  • Pros
    • Disable auto rotation of Flash Lite content
    • Produce content for one unique screen resolution (e.g: 360x640 or 640x360)
  • Cons
    • Rotating movieclip objects are really processor intensive
    • Handle all application movieclips inside a main MovieClip

Real usage

  • Create a MovieClip and paste all application graphics.
  • Copy the MovieClip from the Library and paste on the main timeline.
  • Set the instance name for mcBase
  • Copy and past the following code inside the actions panel on the first frame of your Fla.
fscommand2("DisableKeypadCompatibilityMode");
fscommand2("FullScreen", "true");
 
Stage.scaleMode = "noScale";
 
import com.i2tecnologia.base.UIBase;
var base:UIBase = new UIBase(mcBase);
  • Create the path structure com/i2tecnologia/base/UIBase.
  • Create the UIBase.as actionscript file at the above directory.
  • Paste the following code inside the UIBase.as actionscript file.
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;
}
}
}

Flash Lite 3.1

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);

Download

The sample shown in this article is available for download here: Media:Disable rotation flashlite.zip

--Felipe Andrade 15:04, 19 June 2009 (EEST)

This page was last modified on 14 May 2013, at 06:02.
40 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×