Re: [Flashcoders] am i loaded by another swf?
Ah.. ok. Thanks Henrik. Best, Karl On Feb 15, 2012, at 4:32 PM, Henrik Andersson wrote: Karl DeSaulniers skriver: Is there no reference in AS3 like AS2 where you can look with _level0 for the top level MC? The equivalent to levels would be the display list of the stage itself. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] am i loaded by another swf?
Karl DeSaulniers skriver: > Is there no reference in AS3 like AS2 where you can look with _level0 > for the top level MC? > The equivalent to levels would be the display list of the stage itself. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] am i loaded by another swf?
Is there no reference in AS3 like AS2 where you can look with _level0 for the top level MC? Best, Karl On Feb 15, 2012, at 4:13 PM, Gerry Beauregard wrote: I think that if a SWF is loaded by another SWF (e.g. using SWFLoader), 'stage' will be null. -Gerry On 2012-02-16 , at 04:07 , g...@engineeredarts.co.uk wrote: Hi, Can you check if the parent exists, and is there a way to determine if this is the document/main class? Glen Sent from my HTC - Reply message - From: "Ktu" To: "Flash Coders" Subject: [Flashcoders] am i loaded by another swf? Date: Wed, Feb 15, 2012 19:55 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 -- 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 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] am i loaded by another swf?
I think that if a SWF is loaded by another SWF (e.g. using SWFLoader), 'stage' will be null. -Gerry On 2012-02-16 , at 04:07 , g...@engineeredarts.co.uk wrote: > Hi, Can you check if the parent exists, and is there a way to determine if > this is the document/main class? > Glen > > Sent from my HTC > > - Reply message - > From: "Ktu" > To: "Flash Coders" > Subject: [Flashcoders] am i loaded by another swf? > Date: Wed, Feb 15, 2012 19:55 > > > 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 > > -- > 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 > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] am i loaded by another swf?
Ktu skriver: > 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? > If a movie is loaded by a Loader that is on the display tree of the stage the loaded movie DOES NOT have access to the stage. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] am i loaded by another swf?
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 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 > 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
Re: [Flashcoders] am i loaded by another swf?
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 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! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] am i loaded by another swf?
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
Re: [Flashcoders] am i loaded by another swf?
Hi, Can you check if the parent exists, and is there a way to determine if this is the document/main class? Glen Sent from my HTC - Reply message - From: "Ktu" To: "Flash Coders" Subject: [Flashcoders] am i loaded by another swf? Date: Wed, Feb 15, 2012 19:55 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 -- 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 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] am i loaded by another swf?
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 -- 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