PDA

View Full Version : Extended MovieClip scope issues.



tduppstadt
October 8th, 2009, 09:00 AM
I have the following build of a nested MovieClip.

mBreadcrumbs{ mHost{ mIconImg, mIconText } }

mHost is attached to an extended MovieClip class. Within the class itself when I test some trace results I get the following...

this.name = mHost (correct)
this.parent.name = mBreadcrumbs (correct)
this.mIconImg.name = null (out of scope?)

So my question is: How come the movieClip within the classed MovieClip seems out of scope? and How can I access that movieClip (preferably relative from the classed MovieClip and not from the stage).

Thanks in advance!

senocular
October 8th, 2009, 10:16 AM
Out of scope? Looks instead like you never defined its name.

tduppstadt
October 8th, 2009, 10:43 AM
On the stage the instance names are all defined... I'm simply trying to call it by the instance name from the classed MovieClip that holds it.

Perhaps the way I listed them in my post was confusing and inferred that I was defining them but I was just simplifying the trace results.. So I should have posted....

trace(this.name);
// output: mHost (correct)

trace(this.parent.name);
// output: mBreadcrumbs (correct)

trace(this.mIconImg.name);
// output: null (out of scope?)


Thanks again... Any ideas?

senocular
October 8th, 2009, 10:46 AM
if mIconImg is not null but its name is, then it was never given a name or somehow its name had been nulled. Scope is not a factor.

tduppstadt
October 8th, 2009, 10:54 AM
Hehe... Yep... That's it (embarrassed). In the class a variable pointer with the same name as the movieclip was causing the conflict.

Ya know it's always the little things, I should have seen that....

Thanks for your help!