Skip to main content
Known Participant
October 24, 2009
Question

How do i reference a movie clip instance name from inside child movie clips.

  • October 24, 2009
  • 1 reply
  • 1999 views

I have a label I am referencing form a movie clip inside the movie clip which contains the "label_2."

Here is the code I used:

MovieClip(parent.parent).gotoAndPlay("return_2");

Now I need to reference a instance name of a movie clip in side the same scene.

What would the code be?

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
October 24, 2009

if your first sentence were true you would use:

MovieClip(parent).gotoAndPlay("return_2");

but, if there's a movieclip with instance name mc on the timeline that contains "return_2"  and your parent.parent reference finds that label, you would use:

MovieClip(parent.parent).mc;

to reference mc.

Known Participant
October 24, 2009

Well I tried referencing the movie clip through instance name and through the label method and both are not playing the movie clip.

How would I reference it by frame?

kglad
Community Expert
Community Expert
October 24, 2009

you can't avoid using the correct path and object reference.  how is the movieclip created (with code or in the authoring environment)?  what's the relationship between the movieclip that contains mc and the one the will contain the code referencing mc?