android - How to Determine and Set Screen Size at run time using action script? -
Hey, I'm developing an Android application using AdWords Script (ADO Air One) because my SSF application Screen size appoos is 840X480 ... Can I find the screen size of the application running Android device at runtime and set the screen size accordingly? if so, how?? PS - I'm still happy with the verb script Thanks
Actually, make your app liquid For (or responsive) follow these steps:
-
Align the step and set the scale mode:
stage.scaleMode = StageScaleMode NO_SCALE; Stage.align = StageAlign.TOP_LEFT; -
Listen for re-size events on the forum:
stage.addEventListener (event. RESIZE, stageResizeHandler); Function Step ResizeHandler (E: Event): Zero {stage.stageWidth; // How big is the width stage.stageHeight; // How big is the height // So if you had a box, and you wanted to focus it on the screen: box.x = (stage.stageWidth - box.width) * .5; Box.y = (Step. Stage High - Box. High) * .5; // Create a background graphics. clear (); Graphics.beginFill (0xFF0000); Graphics.drawRect (0,0, stage.stageWidth, stage.stageHeight); Graphics.endFill (); }
If you want to know only the physical size of the display, then you can do this abilities in the class:
Abilities ScreenerationXX; Capabilities.screenResolutionY; or
step. Full screenshot; Stage.fullScreenHeight; This usually does not include any tool bars / notification bars.
If you want your content to be scaled, then set whatever you want on the scale such as:
stage.scaleMode = Stagescale mode.noborder; // It will zoom your app till it does not fill the full screen, although it may be a bit cropping if necessary. To view other scaling modes,
Comments
Post a Comment