Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
didnt let me attach. Ill email.
Copy link to clipboard
Copied
can I get your email?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
You should probably start by reading the docs and/or google:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/events/Event.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.
Copy link to clipboard
Copied
okay good info. thanks.
In the mean time I need to figure this out asap. Can I send you my Flash file?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more