Solved

flash AS3 gotoAndPlay question

Posted on 2010-08-20
8
514 Views
Last Modified: 2013-11-11
there are many different examples out there that show how to get from one movie clip to a specific frame:

MovieClip(parent).gotoAndStop("intro");

But what if there was a movieclip within the "intro" frame you wanted to go to?  I have not seen a specific post that talks about this.

I am guessing the movieclip within intro you can navigate to a specific frame too?
Help please!
0
Comment
Question by:g0mab2
8 Comments
 
LVL 19

Expert Comment

by:quizengine
Comment Utility
I write in as2, so I don't know if the syntax is the same in as3, but is as2 you would write

daddybear.mommybear.babybear.gotoAndStop("babysbed");

where the mc 'daddybear' is on the main timeline (root) and the mommybear clip is inside the daddybear clip, and the babybear clip is inside the mommybear clip. Make sense ?
0
 

Author Comment

by:g0mab2
Comment Utility
I tried that, there has to be something else to it since I keep getting the undesired response.
I am already in a movieclip, so I have to MovieClip(parent).

inside the main_parent frame, there is a mc called MAIN_MC that I want to open to a specific location.

so I have been doing this
MovieClip(parent).main_parent.MAIN_MC.gotoAndStop("portfolio");

but this is not working.
0
 
LVL 39

Expert Comment

by:blue-genie
Comment Utility
can you explain the setup more precisely?

on main timeline you have instance x
instance x you have .....

where you're calling the code from etc.

0
 
LVL 5

Accepted Solution

by:
truromeo4juliet earned 300 total points
Comment Utility
depending on where you're calling your action from, you may be using unnecessary nesting to control your movie...

for example, if you're on the root timline, not inside any movieclip, and you're assigning an action to a frame to control your "MAIN_MC" movie clip, then I BELIEVE you would do this:

MovieClip(root).MAIN_MC.gotoAndStop("portfolio");

I've actually got to tackle this issue when I get home as well, so if that doesn't work, I'll have a better solution when I get home when I have flash in front of me.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Closing Comment

by:g0mab2
Comment Utility
truromeo4juliet:
it worked, thank you so much!
0
 

Author Comment

by:g0mab2
Comment Utility
what if when you go to the root, the movie clip you want to go to is on a different frame?

for instance:
MovieClip(root).MAIN_MC.gotoAndStop("portfolio");

this works if the call comes from the same root frame that portfolio is in.

from root I would like to go one frame over, and two clips down, would that be:

MovieClip(root).main_parent.MAIN_MC.gotoAndStop("portfolio");
0
 
LVL 5

Expert Comment

by:truromeo4juliet
Comment Utility
I'm not sure of what you're asking when you say you want to go one frame over and two clips down. Can you elaborate?
0
 

Author Comment

by:g0mab2
Comment Utility
I figured it out, thanks anyway.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now