PDA

View Full Version : DisplayObject stage property question


mfalomir
09-23-2008, 07:45 PM
Hi, I have a question regarding the stage property of a DisplayObject. As far as I understand, that property is null if a DisplayObject has not been added to the display list...right ? So, I have swfA serving as a prealoder of other SWFs, the I load swfB, after is completely loaded I add it to the display list:

addChild(loader) or addChild( loader.content )

and if I trace( stage ) inside the loaded swf is null ... why ? I know that is inside a loader object..but still, isn't supposed to work ?

Thanks in advanced...

xxneon
09-23-2008, 08:41 PM
it might be an issue when the execution of the code happens.. you might want to add the loader object to the display list right away when you make the load() call to load in swfB.. if that doesnt seem to help any .. then check into assigning an EVENT.ADDED_TO_STAGE event listener.. that way you know that there should be no question and the stage property should be defined at that point.

mfalomir
09-23-2008, 09:42 PM
yep, that was it :) thanks ... I also put a 1 sec. wait timer before the loaded swf code execution and work as well, by Im sticking with the ADDED_TO_STAGE event :)

Cheers...