can .... anyway im not an expert of this code but then id do some experiment (trial an error) with flashcs3exampleplugin1.fla
thanks to Zephyr for settle in my code ie the littleplanet code...
but id guess calling code from xml is much more better, just like the reset button...
this is code for stage width listeners..
|
Quellcode
|
1
2
3
|
if (stage){// run standalone// no automatic scalingstage.scaleMode = StageScaleMode.NO_SCALE;// align on top left cornerstage.align = StageAlign.TOP_LEFT;startup_plugin(null);}else{// run as plugin in krpanothis.addEventListener(Event.ADDED_TO_STAGE, startup_plugin);}
function startup_plugin(event:Event):void{// setup a global RESIZE event to set the positions of all elements when resizeingstage.addEventListener(Event.RESIZE, stage_resize);// add a Fullscreen event to make changes when switching to fullscreen and backstage.addEventListener(FullScreenEvent.FULL_SCREEN, stage_fullscreen_event);// do a first resize stage_resize(null);get_current_values();}
|
this is the backbar (black bar) that span accordingly to width of any stage size...
|
Quellcode
|
1
2
|
function stage_resize(event:Event):void{// dynamic set the position of the elementsvar screenwidth:Number = stage.stageWidth;var screenheight:Number = stage.stageHeight;
// background bar - at bottom, scale to widththis.backbar.width = screenwidth;this.backbar.y = screenheight;this.backbar.useHandCursor = false;}
|
cheers..