sorry now, what if the loader is already in a display list when it runs that first frame? is it still not aware of the stage?
On Wed, Feb 15, 2012 at 3:33 PM, Ktu <ktu_fl...@cataclysmicrewind.com>wrote: > so I could do something like this: > > > public function Main():void { > if (stage) { > stage.scaleMode = StageScaleMode.NO_SCALE; > stage.align = StageAlign.TOP_LEFT; > init(); > } else addEventListener(Event.ADDED_TO_STAGE, init); > } > > private function init(e:Event = null):void { > removeEventListener (Event.ADDED_TO_STAGE, init); > // entry point > } > > > ? > > > > > On Wed, Feb 15, 2012 at 3:07 PM, Henrik Andersson > <he...@henke37.cjb.net>wrote: > >> Ktu skriver: >> > Hey List, >> > >> > I'm building a swf, and i want to set the stage.scaleMode and align >> ONLY IF >> > my swf is the top level swf, and was not loaded by another swf. >> > >> > anyone know how to find out if a swf was loaded by another swf? >> > >> > need more info? >> > >> > thanks >> > >> >> You can't know in the general case, but here is a good enough guess: >> >> function isFirstMovie():Boolean { >> return stage && root==stage.getChildAt(1); >> } >> >> There is however one specific case where you can know: During the >> construction of the first frame (that includes the document class >> constructor). Check if you are on the stage during that. Only the first >> loaded movie will be, any subsequently loaded movies will not be. >> _______________________________________________ >> Flashcoders mailing list >> Flashcoders@chattyfig.figleaf.com >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> > > > > -- > Ktu; > > The information contained in this message may or may not be privileged > and/or confidential. If you are NOT the intended recipient, > congratulations, you got mail! > -- Ktu; The information contained in this message may or may not be privileged and/or confidential. If you are NOT the intended recipient, congratulations, you got mail! _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders