Air/flash Mobile/as3/ Lowering Resolution Or Upscaling For Performance
So I've got an Android/IOS Air app built in Flash CS6 (NOT using Starling or Stage3D). In the .fla, the stage size is set to 640x1024. Now i noticed that the stage resolution does
Solution 1:
you could use something like
privatestatic function handleResize() :void {
var deviceSize:Rectangle = new Rectangle(0, 0, stage.stageWidth,
stage.stageHeight);
// adjust the gui to fit the new device resolution
}
stage.addEventListener(Event.RESIZE, handleResize);
// call handleResize to initialize the first time
handleResize();
// Then set quality valueif(stage.stageHeight>200 && stage.stageHeight<380){myImageQualitySwitchVar=1}
if(stage.stageHeight>380 && stage.stageHeight<680){myImageQualitySwitchVar=2}
if(stage.stageHeight>800){myImageQualitySwitchVar=3}
and inside your MC's you want to load image quality you want, I would created something for your image loaders like
if(myImageQualitySwitchVar==1){Image01.load(new URLRequest("LowQualityIMG.jpg"));}
if(myImageQualitySwitchVar==2){Image01.load(new URLRequest("MediumQualityIMG.jpg"));}
if(myImageQualitySwitchVar==3){Image01.load(new URLRequest("HighQualityIMG.jpg"));}
Its alot of work doing it this way but the only alternative I can think of is to just create different builds for different devices. ie. 4 builds, a phone build for devices using SDk x.x and under and phones above SDk x.x get different build. and another 2 builds for specific tablets above and below SDK x.x.
hope this helps.
Post a Comment for "Air/flash Mobile/as3/ Lowering Resolution Or Upscaling For Performance"