Solved

flash AS3 gotoAndPlay question

Posted on 2010-08-20
8
522 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
ID: 33489351
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
ID: 33489405
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
ID: 33490597
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 5

Accepted Solution

by:
truromeo4juliet earned 300 total points
ID: 33492510
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
 

Author Closing Comment

by:g0mab2
ID: 33493498
truromeo4juliet:
it worked, thank you so much!
0
 

Author Comment

by:g0mab2
ID: 33494168
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
ID: 33656725
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
ID: 33663600
I figured it out, thanks anyway.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

809 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