Button targeting main timeline

I have a button inside of a movieclip inside of a movieclip
on the main stage. I want the button to gotoAndStop in the main
(root) timeline on frame 21. I can't figure out the correct code
for this, this is one of the things I've tried:
on (release) {
gotoAndStop(_root, 25);

should be:
on (release) {
_root.gotoAndStop(25);
Hope that helps!

Similar Messages

  • Targeting main timeline from a button symbol

    I have been using Edge since it's inception. However I have not been using it over the last year as I have not had any contract work for HTML5 animation but I just got a contract to re create animations originally done in Flash. My Edge basics are pretty fresh but I have a hard time doing the following.
    I have a 2 state button up  down which was converted into a symbol with a mouseover to change the state. Now I need to have an onclick event play the main timeline which I cannot seem to grasp.
    Any help coding this?
    Thx
    RD

    Hi, RD-
    Try using sym.getParentSymbol() (if you're only one level down) or sym.getComposition().getStage() to get the main timeline, then call play().
    Hope that helps,
    -Elaine

  • Button on main timeline control movieclip

    Hello,
    I have a stop on my main timeline. At the stop I have a movieclip play. In the movieclip I will have a video play. After the video plays I have a button for the user to continue play until the end of the movieclip. Once the movieclip is done I want to resume back to a specific frame in my main timeline.
    I can't figure out how to make this work. Anyone have any ideas?
    Thanks in advance,
    Paul

    Ned,
    Thanks for the reply and the help.
    I actually got everything to work the way I need it to. I simply had my button in the movieclip continue play then at the end of the last frame, applied a little voodoo and I was all smiles after I tested my Movie. Here's what I did...
    x_btn in movieclip (not on main timeline) -
         x_btn.addEventListener(MouseEvent.MOUSE_DOWN,mouseDownHandler10);
         function mouseDownHandler10(event:MouseEvent):void {
                  gotoAndPlay(41);
    last frame in movie clip -
         MovieClip(root).gotoAndStop(130);
    Paul

  • Problem with nested button controlling main timeline...

    I am new with as3, i like it, but I am suffering
    After I looked on google for trying to figure out my problem I attempt to post here...
    to make it simple, I have a loader that is loading some swf(a scrolling content), with some content, in those swf I am trying to put a "close" button and some other like  next/prev. But no way... normally I thought that the MovieClip(root) would make it but it's seems not to be enough.
    code of the swf:
    var btnclose1:btnclose = new btnclose();
    this.addChild(btnclose1);
    btnclose1.x = 770
    btnclose1.y = 55;
    btnclose.addEventListener(MouseEvent.CLICK, closearchi)
    function closearchi (e:MouseEvent):void {
    MovieClip(root).gotoAndStop(1);
    Thanks by advance...

    Hi Ned,
    Actually, I just saw than the problem come from the timeline itself, but I don't see what to do...
    on the frame 1 of the main timeline, it is loading an empty swf into my container"box":
    var myLoader:Loader = new Loader();
    var myURL:URLRequest = new URLRequest("empty.swf");
    myLoader.load(myURL);
    box.addChild(myLoader);
    on frame 2 I have the first content and so on:
    function loadarchi():void
    var myURL:URLRequest = new URLRequest("archi.swf");
    myLoader.load(myURL);
    loadarchi();
    I did a simple button on the main just for testing purpose, telling him to go to frame 1, it doesn't unlod the content ! there is the problem!
    what is wrong with that? it shoul load the empty swf instead of archi...
    thanks again

  • Call on buttons above main timeline

    Can anyone help? I want to call on a button instance that lives two levels up in a movie clip. So, the mc lives here:
    Scene 1 > startMc > navMC
    (the navMC contains all the buttons)
    I thought "page1_btn.child.child.addEventListener(MouseEvent.CLICK, page1content);" would work but doesn't seem to do it.
    The code on main timeline is:
    function removeF() {
    removeChild(myLoader);
    var myLoader:Loader=new Loader ();
    page1_btn.addEventListener(MouseEvent.CLICK, page1content);
    function page1content(myevent:MouseEvent):void {
        var myURL:URLRequest=new URLRequest("page1.swf");
        myLoader.load(myURL);
        addChild(myLoader);

    If you select the option to permit debugging in the Flash Publish Settings, you can probably get a little more info in the error message pointing at the offending line of code.  In order for buttons to work with event listeners that are assigned for them, the buttons need to be in the presence of that code when it executes.  So if your buttons happen to live a few frames down into the movieclip they reside in, they are not present for the event listener when it is being assigned--in that case you would have to move the listener assignment to where the button exists.  A similar situation exists if you transition the button into place.
    There are other possible causes, but it's a short list, which includes making sure the instance names are assigned and in agreement.

  • How to target main timeline from within 3 mcs in a slidemenu?

    Hello there,
    I am trying to modify a slidemenu script but don't really
    know how to accomplish it. I have a series of buttons within three
    mcs. (this is necessary for the sliding script to work). In the
    original script, the button name is targeted to a label with the
    same name in a new scene.
    The code on the button is:
    on (release) {
    gotoAndStop("/:" add eval("..:text"));
    // THIS goes to the FRAME with the name of the button you
    just clicked on.
    The MC code is:
    // tmi=total menu items
    // dup=new movie duplicates
    // butn=original movie button
    // FIX original Button:
    butn:text = /:Menu0;
    while (Number(n)<Number((/:tmi*2)-1)) {
    n = Number(n)+1;
    dup = "butn" add n;
    duplicateMovieClip("butn", dup, n);
    setProperty(dup, _x, Number(getProperty(dup,
    _x))+Number(n*getProperty(dup, _width)));
    setProperty(dup add "/b", _x, getProperty (dup add "/b", _x)
    + (1));
    set(dup add ":n", n);
    // assign button name from variables
    if (Number(n)<Number(..:tmi)) {
    set(dup add ":text", eval("/:Menu" add n));
    } else {
    set(dup add ":text", eval("/:Menu" add (n-/:tmi)));
    The problem I am having is that I don't want to go to a new
    scene ( because I am only loading photos) but would like to target
    a label on the main menu. I have tried many ways including (my
    label is named "one"):
    on (release) {
    _root.gotoAndStop("Main" "one");
    on (release) {
    _root.gotoAndStop("one");
    on (release) {
    gotoAndStop("Main" "one");
    on (release) {
    _level0.gotoAndStop("one");
    But none of these work. There must be a way to do this no?
    Please someone enlighten me! I need all the help I can get.
    Thanks very much for your support,
    Niki

    Hi,
    i don't where you got this code but it looks like Ascript
    used in flash 4...
    and it's full of syntax errors...
    don't know if this is what you want want but why not try
    something like:
    nrOfBtns = 4;
    //position for each button
    // make button on the root like : myBtn. (mClip or Btn clip )
    buttonStep = myBtn._width+10 // or_height
    // for each button make click tag i.e. in an array is allways
    nice
    clickTag = new Array();
    clickTag[0] = "labelName 0";
    clickTag[1] = "labelName 1";
    clickTag[2] = "labelName 2";
    // create loop
    for (i=0; i<nrOfBtns; i++) {
    // gives you myBtn_0 _1 ,etc.
    duplicateMovieClip("myBtn", "myBtn_"+i, i);
    // places each button 0X150 = 0, 1X150 = 150 position etc.
    _root["myBtn_"+i]._x = i*_root.buttonStep;
    // add other things like click commands:
    // like wich label in the root to goto coming from the array
    _root["myBtn_"+i].clickTag = _root.clickTag
    _root["myBtn_"+i].onRelease = function() {
    _root.gotoAndPlay(this.clickTag);
    trace(this.clickTag);
    hope i could help
    ML

  • How to target button in movieclip back to main timeline

    Hello!
    I have some submenu buttons in a movieclip on the mainline. My first level of navigation in on main timeline. The submenus are grouped in movieclips on the main timeline. I basically used the same code on the main navigation for the sub navigation except the code for the submenus is in that movie clip. My trace statement reads the button is clicked (which was a quantum leap for me) but I know I need some kind of _parent code in there so it knows to go to label back on main timeline. Can anyone help?? I feel like I am so close.
    Also is this an ok way to set this up? I couldn't figure out how to do it in one frame. Any help would be so appreciated. I didn't realize this basic framework was going to be so difficult.
    Here is link:
    http://www.sandraschmitt.com/coclico/index2.html
    Thanks!!
    Sandra
    Here is my code that is on the submenu movieclip:
    Code:
    stop();
    fall.addEventListener(MouseEvent.CLICK, clickSection);
    spring.addEventListener(MouseEvent.CLICK, clickSection);
    function clickSection(evtObj:MouseEvent){
         //trace shows what's happening... in the output window
         trace ("The "+evtObj.target.name+" button was clicked!")
         //go to the section clicked on...
         gotoAndStop(evtObj.target.name);

    One reason I'll never win any awards for my design outlook is because I often follow... if it works, use it.  There are many ways to approach a design and yours is just fine if you understand it.  If it was going to crash something, it would have happened by now.  Some people will go to the extreme of having absolutely no code in a file, some even no library content, writing it all into class files, and not out of necessity, but out of simply believing it's the better way, or a challenge to prove their abilities...  They can have it.  There is a practicality involved with design that allows one to make judgement calls, and if you judge that your design approach is practical for what you understand or for what meets the needs of the project, then you have every right to follow your own path.
    That said... in the event someone should inherit your work somewhere down the road, that's when your approach may fall victim to judgement... if someone cannot follow it or is having trouble putting all the pieces together, or finding them, then you become the fall-person for the whining that ensues.  But you're not likely to have to hear about it.  Still, someday, if you find yourself in a position where you inherit someone's design... and you start whining about how they did it, you'll come to appreciate the reasons for giving consideration to how you approach your designs.

  • How to add button inside move clip and call it from main timeline?

    Hi,
    On the main timeline I  have a movie clip called clock_mc and playBtn
    playBtn is  placed in the center of clock_mc
    When you press playBtn clock_mc starts playing
    playBtn.addEventListener(MouseEvent.CLICK, playClock);
    function playClock(event:MouseEvent):void
        if (event.target == playBtn)
            clock_mc.play();
            playBtn.visible = false;
            trace ("play button was clicked");
    This is working fine for me.
    But I want to add replayBtn to the last frame of clock_mc and set up the function on main Timeline.
    Another words when the clock_mc rich last frame you see replayBtn.
    code example:
    replayBtn.addEventListener(MouseEvent.CLICK, playClock);
        if (event.target == replayBtn)
            clock_mc.play();
            replayBtn.visible = false;
            trace ("replay button was clicked");
    I've tryed to placed the replayBtn on the stage on the main timeline and I've set it up to replayBtn.visible = false;
    And then I add replayBtn.visible = true; to last AS frame of clock_mc but it wont work
    Even when I put the button physically to the last frame of clock_mc it will not work either.
    Please help

    I've solved the problem:-)
    I've set replayBtn.visible = false; on first frame of clock_mc
    and  replayBtn.visible = true; at the last frame
    and than as you sugested I'v add:
    clock_mc.replayBtn.addEventListener(MouseEvent.CLICK, replayClock);
    function replayClock(event:MouseEvent):void
            clock_mc.play();
            trace ("replay button was clicked");
    I couldn't see replayBtn at the firs stage because I have clockTween assosiated with clock:
    clockTween = new Tween(clock_mc, "x", Regular.easeOut, -469,438, .5, true);
    and I had replyBtn in the wrong place so when clock_mc was coming up on the stage replayBtn was on the left side of the stage :/
    Now I have to solve only one thing.
    Maybe you would have any suggestions please.
    I've set up stop(); in a first frame of clock_mc
    that when you see clock_mc sliding in it has to wait for playBtn to be clicked
    because I have two tween:
            clockTween = new Tween(clock_mc, "x", Regular.easeOut, -469,438, .5, true);
            playTween = new Tween(playBtn, "x", Regular.easeOut, -720,514, .5, true);
            playBtn.visible = true;
    so when you click on playBtn:
    function playClock(event:MouseEvent):void
        if (event.target == playBtn)
            clock_mc.play();
            playBtn.visible = false;
            trace ("play button was clicked");
    everythink is working fine except when I clik on replayBtn it play for I sec because there is stop(); on the first frame of clock_mc

  • Can't get button in sub movie to link back to main timeline

    Hi All.....
    First, thank you for helping me! I am pulling my hair out. I
    know there is an easy answer to this question, but I can't figure
    it out.
    I have my main timeline (Scene 1) and then on frame 5, I have
    a movie that plays for about 70 frames (within itself). On the main
    timeline it is only 3 frames long, and I have an action at the top
    layer to stop at the first frame.
    At the end of the 70 frame movie, I have a "next" button; the
    action is in normal mode;
    on (press) {
    gotoAndPlay("Scene 1", 11);
    I am ultimately telling this button to go back to the main
    timeline (scene 1) and continue on with the next movie.
    When I publish, the movie goes through just fine, gets to the
    next button, I press it and it goes to the 11th frame of the that
    same movie, instead of the 11th frame of the main timeline (scene
    1).
    Help! I appreciate it...let me know if I left anything
    out...........
    Aubry

    aubrycan wrote:
    > Ahh!
    > Thank you! It worked!
    >
    > You have saved me. :-)
    better yet label the frame you like to target and target that
    label
    _root.gotoAndPlay("labelNameHere");
    There is no scenes in SWF file upon export. So if you have 10
    frame in scene 1
    and 10 in scene 2, the frame 10 in scene two become frame
    number 20.
    The action sugested by FamousSeamus is not really correct
    even tho it might work,
    but as soon as you try to target frames across multiple
    scenes, you can't refer to them
    by their numbers unless it's one long scene only.
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Attempt to move main timeline from inside a movie clip breaks menu buttons.

    I am attempting to have the main timeline move from a stopped position over a movie clip to frame 1, where my start menu is.
    The code I'm using does move the timeline but in doing so it somehow breaks the 4 buttons I have in frame 1.
    My code in the movie clip:
    stop()
    function replayMovie(event:MouseEvent):void
    MovieClip(parent).gotoAndStop(1);
    Menu.addEventListener(MouseEvent.CLICK, replayMovie);
    My code in frame 1 of the main timeline:
    stop();
    function bo(event:MouseEvent):void
    gotoAndPlay(21)
    SoundMixer.stopAll()
    espesp.addEventListener(MouseEvent.CLICK, bo);
    function ho(event:MouseEvent):void
    gotoAndPlay(31)
    SoundMixer.stopAll()
    espeng.addEventListener(MouseEvent.CLICK, ho);
    function yo(event:MouseEvent):void
    gotoAndPlay(41)
    SoundMixer.stopAll()
    engesp.addEventListener(MouseEvent.CLICK, yo);
    function go(event:MouseEvent):void
    gotoAndPlay(51)
    SoundMixer.stopAll()
    engeng.addEventListener(MouseEvent.CLICK, go);
    The error output when I use my Menu button at the end of the movie clip.
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at SSubjunctiveProjNewgrounds_fla::MainTimeline/frame1()
    at flash.display::MovieClip/gotoAndStop()
    at SSubjunctiveProjNewgrounds_fla::Esp_5/replayMovie()
    Any help would be greatly appreciated.

    For the sake of space, I'll leave out all the package declarations and class declarations and just talk about the functions.
    First, the Game class, it has two functions.  The first one is the constructor function and it launches at the beginning of the game:  First the Game function:
    public function Game():void
    //Game code goes here
    }//Game
    We want to listen for someone to click the mouse on the MenuPage, so lets create a new MenuPage and add a listener to the button contiained within it.
    public function Game():void
    menuPage = new MenuPage;
    menuPage.startButton.addEventListener(MouseEvent.CLICK, startGame);
    addChild(menuPage);
    }//Game
    You will notice that before I declared a variable var menuPage:MenuPage, but that's all I did was declare it.  I didn't really make a new instance of it, I just set aside space for it.  In the first line within the Game function, I'm actually turning that variable into a new instance of a MenuPage.
    We don't have a picture of this imaginary menuPage instance, but lets' assume that in our MenuPage MovieClip in the library, we created a SimpleButton called startButton.  Here, I'm adding an EventListener that patiently waits for someone to click that button.  Once we receive that event, Flash is told to call the startGame function.
    As you get better at this, you'll get into custom events, and the eventListener for the button will exist in the MenuPage class file, or even in another class file that you create just for the button.  Something like StartButton.as  But for now, we can do it as above.
    Now the startGame function:
              public function startGame(evt:MouseEvent):void
    //Remove the start Page
    //Add the zombie
    //Add the gun
    }//startGame
    And we'll replace those comments with real code.  It follows along with what we just did above.
    public function startGame(evt:MouseEvent):void
    zombie = new Zombie;
    addChild(zombie);
    gun = new Gun;
    addChild(gun);
    And we also want to clean up some by removing the menuPage, and throwing out the eventListener.
    public function startGame(evt:MouseEvent):void
    zombie = new Zombie;
    addChild(zombie);
    gun = new Gun;
    addChild(gun);
    menuPage.startButton.removeEventListener(MouseEvent.Click,startGame);
    removeChild(menuPage);
    }//startGame
    Now our Game class is complete.
    The Zombie Class
    public function zombieWalk(evt:Event):void
    this.addEventListener(Event.ENTER_FRAME,zombieWalk);
    this.x = this.x + 10;
    }//zombieWalk
    Notice we've added a function to the Zombie Class.
    The first function adds an EventListener to the zombie.  We can use the word this and actionScript knows we're talking about the zombie that the class is written for.  This listener fires off every frame.  If our FLA file is set to 12fps, then 12 times every second it will call on the zombieWalk function.
    The zombie walk function moves the zombie 10 pixels to the right every time the function is called.
    On a more advanced level, you'll want to add animation in the MovieClip to move the zombie legs.  You'll also want to use Timer events to space out how often the funtion fires and not ENTER_FRAME events.  And you'll want to use a static constant to establish how far the zombie moves.  We have it now set to 10 pixels, but that can get irritating if we want to change that value later.  But again, baby steps.
    And finally, the Gun class
    public function Gun():void
    this.addEventListener(MouseEvent.CLICK, fireGun);
    }//function
    public function fireGun(evt:MouseEvent):void
    this.gotoAndPlay(2);
    }//fireGun
    First we add an EventListener for when someone clicks on the gun.  Once this happens, the listener calls on the fireGun function.
    The fireGun function takes advantage of the frames within the Gun MovieClip.  Say we have three frames in the Gun MovieClip.  The first is just a picture of the gun.  The second is the gun with a flash coming out of the nozzle.  And the third is the gun at rest again.  The line this.gotoAndPlay(2) sends the gun to the second frame with the flash graphic.
    For this to work, each frame in the Gun MovieClip has to have some stop and play commands.
    But.. you said no code on our timeline!! Liar!
    I know.  This is the exception.  You will need basic stop() commands and gotoAndPlay commands to loop animations.  Any MovieClip that has more than one frame will need something to control it.
    So our Gun MovieCLip has the following:
    Frame 1: stop();
    Frame 2: no actionScript... and I mean nothing, not even the words, "no actionScript"
    Frame 3: gotoAndStop(1);
    This will loop the gun to the beginning and wait for the next time the user clicks the gun.
    Advanced features of the Gun class might include a Bullet.as sub-class that creates a bullet MovieClip to fly across the screen.  Sound to play when the shooting takes place.  Object collision detection to see if the bullet hits the target.  And a means by which a custom event will tell the Game.as class that a zombie has been hit and it should be removed from the stage.
    As you go down the rabbit hole of ActionScript 3, you will find yourself at a point where it's just a matter of getting the syntax right for all the built in functions and classes.  Arrays, Loaders, casting variable types.. all that stuff will come.
    I hope this has been helfpul.  It's been on my to-do list for a long time.  When I first started out, no one could provide me with basic answers for how all these classes and whatnot worked.  After teaching myself AS3 for 2 years and reading a gabillion books, I think I've gotten to a point where I'm pretty comfortable with it all.

  • Targeting the main timeline

    Trying to make the switch from AS2 to AS3 and like many
    before me, becoming confused.
    I've laid out three movieClips on my main timeline (named,
    "main") and spaced them five frames apart, nice and tidy, like I
    like to do. Each frame on the main timeline containing a movieClip
    has been given a unique frame label. My problem is, I want to have
    the movieClips jump to the next targeted movieClip on the main
    timeline after clicking a button, or upon entering the last frame
    of its predecessor, in some cases. In AS2 the was easy to do this
    was by using the gotoAndPlay function and targeting to the_root
    timeline. Now I can't figure out what to do. I can make any button
    inside a movieClip target a specific frame within that same mc, but
    cannot make a jump to the main timeline to play the next movieClip.
    What am I missing here? I'm a noobie at AS3 and fumbling my
    way forward. (should be obvious now) Is there a simple way to refer
    back to the main timeline, which is only one level up? What am I
    missing?
    Here's as far as I got with the AS3 code within the mcs:
    stop();
    cont5_mc.addEventListener(MouseEvent.CLICK, onClick2);
    function onClick2(event:MouseEvent):void
    trace("test");
    cont5_mc.buttonMode = true;
    The trace function runs true so it's a matter of telling the
    player how to get to the main timeline and frame label.
    TIA for your help, all you flashy genius . . . Speak to me
    like I am a three year old. -grin-
    thokitts

    kglad:
    Thank you for your instant reply. I see you sent it out last
    night. Really appreciated. Got my button in movieClip1 to refer
    back to movieClip2 on the main timeline with your help but now am
    presented with the issue of having the last frame of movieClip2
    automatically taking the viewer back to the main timeline to begin
    playing movieClip3, located on frame label "gsm".
    Again, I know this should be easy, but conceptually I am
    having a problem with how to do this. I don't have a button to
    attach the AS3 to and this new syntax is confusing to me. Nor do I
    want this to be a button based decision on the viewer's part. How
    do I attach this automatic jump back to the main timeline, frame
    label "gsm"? By an enterFrame event, which seems old school AS2? or
    stage.addEventListener? Is enterFrame even the way to do it
    anymore?
    Lynda.com tutorials are great but I'm struggling with this.
    TIA
    Thomas

  • Use button on mc  to perfrom function on main timeline

    I Was wondering how (or if it is posiible) to use a button I
    have in a movie clip to perform a function on the main timeline.
    Specifically, I want the button in the movie clip to gotoAndStop on
    a frame in the main timeline. Any suggestions?

    Hi,
    Then you would target the movie clip.
    So you would give the mc an instance name (like myClip_mc )
    then just add this into your code ....
    button1.onRelease = function() {
    _root.myClip_mc.gotoAndStop(20);
    This would tell the myClip_mc to stop on frame 20. Providing
    the mc is located in the main timeline that is.
    You can see from the code that we are going to the _root and
    looking for the myClip_mc. If it is held within another mc (say
    Holder_mc) then the code would change to
    _root.Holder_mc.myClip_mc.gotoAndStop(20;
    for cs3 (actionscript 3) it would be this
    button1.addEventListener(MouseEvent.CLICK,clickHandler);
    function clickHandler(event:MouseEvent):void{
    _root.myClip_mc.gotoAndStop(20);
    Hope this helps
    Alan

  • How to control main timeline from buttons in a movieclip - job in jeopardy!

    I am trying to do a simple thing in theory. In my main timeline I have a series of images with frame labels for each. In a movieclip (with its own labels & script) below the images, I have two panels of butttons that flop back and forth (to save space). The idea is to simply have the main timeline play the frame specified by the corresponding button in the movieclip. I tried the parent.child thing but either im doing it wrong or that isnt the solution. If anyone can help me I will be saved from certain death. If you think any other part of my project may be to blame, Ill be happy to provide anything that can help. Thanks in advance.
    Here is my script:
    ActionScript Code:
    function on1click(evt:MouseEvent):void {
        gotoAndPlay("pic1");
    thumbPanel.pic1_btn.addEventListener(MouseEvent.CLICK, on1click);
    this is the error: 
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at gallery_fla::MainTimeline/frame1()

    The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....
    - is not in the display list
    - doesn't have an instance name (or the instance name is mispelled)
    - does not exist in the frame where that code is trying to talk to it
    - is animated into place but is not assigned instance names in every keyframe for it
    - is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).
    If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

  • Help with button that goes back to main timeline from movieclip

    I have a movie created that is broken down into sections on the timeline (home about contact etc)
    Each section has a movieclip
    I want to be able to be in the about movieclip and click a button that will bring you back to the main timeline contact section
    Heres is the actionscript I am using to navigate the main timeline for each section
    stop();
    //handle events for buttons...
    index.addEventListener(MouseEvent.CLICK, clickSection);
    about.addEventListener(MouseEvent.CLICK, clickSection);
    wind.addEventListener(MouseEvent.CLICK, clickSection);
    turbines.addEventListener(MouseEvent.CLICK, clickSection);
    services.addEventListener(MouseEvent.CLICK, clickSection);
    invest.addEventListener(MouseEvent.CLICK, clickSection);
    contact.addEventListener(MouseEvent.CLICK, clickSection);
    function clickSection(evtObj:MouseEvent){
                    //go to the section clicked on...
                    gotoAndStop(evtObj.target.name);

    if that code is on the timeline of a movieclip whose parent is the main timeline, use:
    MovieClip(parent).gotoAndStop("frame label in main timeline");

  • In actionscript 3.0 how do i make a nested movie clip button go to a frame on the main timeline

    I am making a website based in flash actionscript 3.0 i have a button nested in its own movie clip, because I have the button expanding to be able to read it i have figured out the only way to do this is by creating it as a movie clipa nd inside the movie clip creating it as a button
    I added an event listener to the blog button by saying,
    blog.addEventListener(MouseEvent.ROLL_OVER,gotoblog);
    function gotoblog(evtobj:MouseEvent){
         gotoAndStop(2)
    this part of the code works it goes to the 2nd frame of the timeline it is in and stops wich is a blown up version of the origanal symbol
    i added on frame 2 a second command
    blog.addEventListener(MouseEvent.CLICK.gotoblogpage);
    function gotoblogpage(evtobj:MouseEvent){
    gotoAndStop("blogframe")
    trace("the blog button was clicked")
    i have named the symbol blog and have name the frame of where the blog page is going to be "blogframe" this line of code at the bottom is where i run into trouble the output window in Flash is saying "The blog button was clicked" just like i want it to. no errors are accouring why than is the playhead not going to frame "blogframe"? if the button is working when i click it the code is right i belive the problem here is it does not want the playhead to go to the frame i want it to. So i gues my question is, how can i make a button withing a movie clip interact with the main timeline?

    I have a similar problem if could please help me i'd really apreciate it!!
    So i have a looping animation of some thumbnails, the hierarchy goes like this
    Scene1(main timeline) -> imgBar(MC)->imgBarB(MC within the imgBar MC)
    My buttons symbols are in the last MC "imgBarB" where i have this code:
    ss1.addEventListener(MouseEvent.CLICK, OneButtonClicked);
      function OneButtonClicked(event:MouseEvent):void{
      MovieClip(root).gotoAndStop("ssbox1");
    I want to control the Btns in my "imgBarB" MC to play a labeled frame(named "ssbox1") on another MC on the main timeline,this other MC goes like this:
    Scene1(main timeline)->ssbox_mc(MC where my labeled frame is)

Maybe you are looking for