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?

Known Participant
October 24, 2009

You should probably start by reading the docs and/or google:

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/events/Event.html

http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7fca.html

http://www.google.com/search?hl=en&q=AS3+events

Once you got the basics down, look into creating/using your own custom events:

http://www.google.com/search?hl=en&q=AS3++custom+events

http://www.adobe.com/devnet/actionscript/articles/event_handling_as3.html

Event dispatching and event handling is one of the most important things about ActionScript. The sooner you get into them, the better.


okay good info. thanks.

In the mean time I need to figure this out asap. Can I send you my Flash file?