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 <[email protected]>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
> [email protected]
> 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
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to