Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Oct 23, 2009 Oct 23, 2009

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?

TOPICS
ActionScript
2.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 23, 2009 Oct 23, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 23, 2009 Oct 23, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 23, 2009 Oct 23, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 23, 2009 Oct 23, 2009

I attached the part of my Flash website that I am trying to get working. The movie function I am trying to get working is clicking on the logo in the center, having it open, which it does, then when I click on "close" button I want it to reverse close out and go back to the original fade in of "that particular" logo.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 23, 2009 Oct 23, 2009

didnt let me attach. Ill email.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 23, 2009 Oct 23, 2009

can I get your email?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 23, 2009 Oct 23, 2009

Look into dispatching events instead of (trying to) reference parent objects.

A child should never access its parent (or grandparent) directly.

Dispatching events is the way to go.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 23, 2009 Oct 23, 2009

I dont know a whole lot about flash so I am kind of confused. Is there anyway I can send you a same movie of what I am talking about?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 23, 2009 Oct 23, 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-7fc...

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 23, 2009 Oct 23, 2009
LATEST

okay good info. thanks.

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines