Skip to main content
El_Arcon
Inspiring
June 21, 2010
Answered

External SWF Parent??

  • June 21, 2010
  • 1 reply
  • 719 views

hello there guys..,

i need help in understanding external swf parent,let me describe it a little more about what i mean:

"is it by default when we load and external swf and eventhought we add it as a child of container (an instance of sprite class which we create and then add it to the stage) that the parent of that loaded swf is stage??? "

i do ask this question because i tried to load an external swf and then add it to the container but when i trace it the loaded swf does not count as the child of the container but the stage (i do this by tracing the stage.numChildren and container.numChildren)

thanks for your time and your help..,

i do appreciate any help greatly..,

This topic has been closed for replies.
Correct answer kglad

if you load a swf (using the loader class), the swf is a child of the loader and the swf's parent is the loader.

if you add the loader to the displaylist, then the loaded swf's parent.parent is a displaylist object.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 21, 2010

if you load a swf (using the loader class), the swf is a child of the loader and the swf's parent is the loader.

if you add the loader to the displaylist, then the loaded swf's parent.parent is a displaylist object.

El_Arcon
El_ArconAuthor
Inspiring
June 22, 2010

i'm sorry i don't really get it but is right if i coclude it like this: "basically the loaded swf will become child of where ever i add it as child"

kglad
Community Expert
Community Expert
June 22, 2010

as long as the loaded swf is an as3 swf, you can reparent the loader's content property, AFTER loading is complete.