Bit of a horrible title.

In Flash i have this as a SWF:

root
-item
--overlay
--color

Where root holds MovieClip with instance name "item" and item holds
moviclips with instance names "color" and "overlay".

Loading this SWF is then converted into a MovieClip

var loadedSWF:MovieClip = //the loaded swf


For some reason, i cannot access overlay and color by instance name
but i can access item.


var item:MovieClip = MovieClip(loadedSWF.item)
// result [MovieClip]


But thats as far as i can reference any other item.

var overlay:MovieClip = MovieClip(loadedSWF.item.overlay)
//result "undefined" or null

var color:MovieClip = MovieClip(loadedSWF.item.color);
//result "undefined" or null



However

item.numChildren()
//returns 2 which is correct (overlay and color)

item.getChildByIndex(1);
//returns color



Because of the nature of this project, i really need to have access to
instance names as opposed to depths. Depths is going to get
complicated and cause mistakes between me and the designer.

Does anyone know why i cannot access the children of item? Yet i can
access the child of loadedSWF.


Thank you.

Reply via email to