Here is a class that scales to fit all devices. In the 'resizeHandler' method, you can use 'stage.stageWidth' or 'stage.stageHeight' to calculate proper scaling according to the device screen size.
| 01 | package { |
| 02 | |
| 03 | import flash.display.MovieClip; |
| 04 | import flash.events.Event; |
| 05 | import flash.display.StageAlign; //for air android resizing |
| 06 | import flash.display.StageScaleMode; //for air android resizing |
| 07 | import flash.system.Capabilities; //used to get screen dimensions |
| 08 | |
| 09 | public class fusion0 extends MovieClip { |
| 10 | |
| 11 | public function fusion0() { |
| 12 | // constructor code |
| 13 | stage.scaleMode = StageScaleMode.NO_SCALE;//for air android resizing |
| 14 | stage.align = StageAlign.TOP_LEFT;//for air android resizing |
| 15 | stage.addEventListener(Event.RESIZE, resizeHandler);//for air android resizing |
| 16 | stage.dispatchEvent(new Event(Event.RESIZE));//for air android resizing |
| 17 | } |
| 18 | |
| 19 | function resizeHandler(event:Event=null):void |
| 20 | { |
| 21 | /* scale code ... */ |
| 22 | |
| 23 | } |
| 24 | |
| 25 | } |
| 26 | |
| 27 | } |