This content has been marked as final. Show 4 replies
you can't do that. create a child of your load target and load into that and attach to the parent.
I'm just wondering why you might want to do this as you could call to - tar.mcMyObj - since the variable will only be local to the method anyway. however you may have more success if you use:
tar.attachMovie( ... );
var my_clip = tar.mcMyObj;
but I'm still thinking that this is a 'timing' (order of events) issue - as the onLoadInit fires when the first frame is ready to render - the obj attached may not be instantiated until the next frame plays - and therefore the obj attached doesn't yet 'exist' at the time the trace is being made - however with the call on the root, the timeline is already established so the object get instantiated immediately - but I'm guessing a bit here. if you place the trace within a onEnterFrame loop i think you'll find that on the second iteration the var returns the reference.
edit: sorry kg - twas thinking about it - i see (above)
clbeech, if my code stores at frame2? i dont know, ain't try it :p
attaching this way is avoid making the MC tree too complex
since Movieclip.attachMovie() returns a reference of attached mc
referencing this way can avoid using tar["blar"+i]
thanks for repkly, but im wondering, a loaded clip is a movieclip isn't it?
a movieclip can contains child isn't it?
when MovieClipLoader.onLoadInit() fired, isn't it able to access the clip?
you can't attach a movieclip to a loaded clip. flash won't allow it. why it isn't allowed, i do not know.
read the work-around in my above message.