How to target button in movieclip on the main timeline

Hello!

I have a few buttons of submenu in a movieclip in the mainline. My first level of navigation in the main timeline. The submenus are grouped into movieclips on the main timeline. I basically used the same code on the main navigation for the navigation sub except the code for the submenus is located in this movie clip. My instruction trace bed button is clicked (which was a quantum leap for me) but I know that I need some kind of code _parent in there so that he knows to go to the label back on the main timeline. Can anyone help? I feel like I'm so close.

Also is this a correct way to set-up? I couldn't figure out how do it in an image. Any help would be so appreciated. I didn't know that this basic framework would be so difficult.

Here is the link:

http://www.sandraschmitt.com/Coclico/index2.html

Thank you!!
Sandra

Here is my code which is on the movieclip submenu:

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 of the reasons that I never won any price for my vision of the design are because I am often... If it works, use it.  There are many ways to approach a design and yours is very good if you understand.  If she was going to smash something, it would have happened now.  Some people don't go to the extreme of having absolutely no code in a file, some even no content library, he wrote everything in files and class not by necessity, but to simply believe that it is the best way, or a challenge to prove their skills...  They have the it.  He participates a practicality with design that allows to make Judgment calls and if you feel that your approach to design is convenient for what you understand or which meets the needs of the project, then you have the right to follow your own path.

That said... in the case where a person must inherit from your work somewhere down the road, that's when your approach can be victim of judgment... If someone can not follow, either found it difficult to put all the pieces together, or find them, then you become the contact person for the moans fall that follows.  But you're not likely to have to hear about it.  Yet, one day, if you are in a position where you inherit a person guestroom... and start whining about how they did it, you will come to appreciate the reasons to consider how approach you your designs.

Tags: Adobe Animate

Similar Questions

  • Goto frame within a movieclip on the main timeline button

    So what I have is a button (then named) on the main timeline. I have a clip on this framework (on the main timeline) and the clip has 3 images I want to be able to scroll using the "Next" button located on the main timeline. How can I do this?

    Thank you

    assign the movieclip an instance name (in the properties panel - for example, mc) and use:

    Next.addEventListener (MouseEvent.CLICK, f);

    function f(e:MouseEvent):void {}

    mc.nextFrame ();

    }

  • Using CS4 Flach and action script 2.0 how to move a specific frame in the main timeline when a movie clip instance come at the end of his chronology?

    Using CS4 Flach and action script 2.0 how to move a specific frame in the main timeline when a movie clip instance come at the end of his chronology?

    code on the last frame of your movieclip instance:

    _root.gotoAndStop ('whatever_frame');  will work unless this swf is loaded into another swf.  in this case, you must use a relative path to the main timeline (for example, _parent or _parent._parent etc.).

  • How to call a function within a movieclip on the main timeline in CC animate canvas?

    Hello world...

    In AS3: Function (fnc name: myFunction) inside a Movieclip (mc1). I'll call you timeline mc1.myFunction ();

    But how to call AnimateCC canvas?

    If you have an instance of MovieClip named "mc" with the following code in to:

    This.Fun = function() {}

    Alert ("Hey!");

    }

    You can call this function (increased to 'this' within the MC) using the oon following the main timeline:

    var root = this;

    this.mc.addEventListener ("click", function() {}

    Console.log (root.mc.fun ());

    });

  • How can I access a variable on the main timeline of a movie nested in HTML5 Canvas

    Hello

    This should be pretty simple, but for some reason, it does not work if I have the wrong syntax.

    But I have a movie clip with a bit of code in it.

    It is a timer.

    I want to be able to program the wait time: since the main scenario and that the timer read this variable on the main timeline.

    I implemented the delay var = 1000 on the main timeline, but then I do not seem able or knows how to get this variable in my code in the nested MC. It is quite difficult to find the reference of the paradigm flash timelines on H5 support pages, so I really appreciate the help.

    tl2 var = this;

    TL2. Stop();

    var delay = delayMain;

    var startTime is createjs. Ticker.getTime ();

    createjs. Ticker.addEventListener ("tick", f);

    {function equation

    If (createjs. Ticker.getTime () - startTime > delay) {}

    TL2. Play();

    createjs. Ticker.removeEventListener ("tick", f);

    }

    }

    If you want to get to a variable defined by a feature any at any depth, you can use the window. As:

    Window.Delay = value;

    in a deeply buried movieclip, can be read in any other level of the project.

  • Access a MovieClip in the main timeline of an external class

    Hello


    I've been struggling with the same question for a few days now, and I don't know it can be easily solved - I have just found a way that works for my case


    Basically I have a series of clips on the main timeline, the name "S1B1' to 'S5B8' as a result. I would like to add to a table in a separate category called "BeatArray".


    For the moment, I found no referencing the MovieClips from the separate class file that works, and I tried many different methods (including adding MovieClip (root). before each one and various other things).

    It's probably worth noting that the external class has already extends MovieClip.


    Any help is greatly appreciated!


    See you soon

    When you instantiate the outer class passes a reference to the main timeline and assign it within the class and use it in your targeting.

  • Button on the main timeline control movieclip

    Hello

    I have a stop in my main script. At the stop, I have a play of movieclip. In the movieclip, I'll have a video playback. After playing the video, I have a button for the user to continue playing until the end of the movieclip. Once the movieclip is done, I want back the return to a specific image in my main script.

    I can't figure out how to make this work. Anyone have any ideas?

    Thanks in advance,

    Paul

    How much of what you just described in currently working properly?

    If it's just the last step to have the game finished main scenario the movieclip, then you might have an event listener assigned to this movieclip in the main timeline.  When the movieclip ends it can send an event of this listener that can trigger an event handler function in the main timeline to tell the main scenario for continued as planned.

    Another less glamorous but more compact approach might be to have a drive inside / at the end of the movieclip to order the main scenario of an act using something like...

    MovieClip (parent) .gotoAndPlay (whatever);

  • Close button in an interpolation that takes back you to the main timeline

    I have a HTML5 canvas document that has 5 separate click to open the motion tweens.  Within each tween, I have a "close" button that I want to return at the beginning of the main timeline.  Right now he's just at the beginning of the timeline to tween movement in an infinite loop.  How can I get to go back to the main scenario for each of the interpolations of?  (For reference, I am a beginner with Animate and JS code and have not been able to find this answer in my many searches on the web).

    you want that code in the main timeline to lead the scenario primary back to its first image and stop, or you want to code on the timeline of a movieclip lead the main timeline at its first image and stop or something else?

    If you want the code on the timeline of a movieclip to lead the main timeline, use:

    this.parent.gotoAndStop (0);  assuming that the parent of the movieclip is the main timeline.

  • How to set a variable in the main timeline of in a symbol?

    Just get started with Animate and coming from Flash, it may be apparent to my question. How do you define a variable for the main timeline of in a symbol?

    I have 24 pairs of clickable elements, each in their own symbols, and 24 of these symbols to sit inside another symbol. I want every 24 to set the global variable even when you click on it. I do not find that this question is anywhere, which makes me think that I can be stuck in a mentality from Flash and approaching the task in a bad way. (However, there are MANY discussions address showing how objects to different levels in the hierarchy.) Which is well covered).

    By the way, how to access a function on the main timeline of in a symbol?

    Adobe should consider putting on foot (or pages) support just for people migration form Flash. In the documents that I've met so far there seems to be a studied effort to refrain from mentioning Flash somehow. I imagine that there are many people out there like me who have a deep background in coding Flash, but start with Animate. We don't need help with most of the basic concepts, but we still have some pretty basic questions on how to achieve certain things in Animate because our knowledge of Flash gets in the way.

    Hi Bill,

    There are a lot of discussions here on the scope, but here's a way to create a global variable:

    code on Stage.compositionReady

    sym.myGlobalVar = 1;

    Then, anywhere in your project, you can check/set this var as follows:

    sym.getComposition () .getStage () .myGlobalVar = 2;

    And here is a way to create a global function:

    code on Stage.compositionReady

    sym.myGlobalFunction = function() {}

    Console.log ('myGlobalFunction');

    }

    Then, anywhere in your project, you can call this function as follows:

    sym.getComposition () .getStage () .myGlobalFunction ();

  • Nested movie meets with the main timeline?

    I am very new to actionscript 3.0 (and actionscript in general also) so it can be done easily.

    My main timeline has two frames. On the first image on a button will take users to the #2 chassis. When the #2 chassis is played, a clip that takes up most of the screen is displayed. Now, is there a button to return to the #1 frame in the main timeline, leave in the movieclip on frame #2.

    How can I get the button "return to the #1 section" to work in the movieclip on frame #2? I guess the button must speak to the main timeline (or something like that), but not really sure.

    Thanks in advance!

    put this on the last image in this clip. I'm assuming that your button has an instance name, my_btn.

    my_btn.addEventListener (MouseEvent.CLICK, btnClicked);
    function btnClicked(event:MouseEvent):void {}
    MovieClip (this.parent) .gotoAndStop (1);
    }

  • in actionscript 3.0 how do a nested movie clip button go to a section on the main timeline

    I do a site based in flash actionscript 3.0, I have a button nested in its own clip, because I have the button bigger to be able to read what I realized the only way to do it is by creating it as a film clipa nd inside the clip in a button

    I've added an event listener for the button of blog, saying:

    blog.addEventListener (MouseEvent.ROLL_OVER, gotoblog);

    function gotoblog(evtobj:MouseEvent) {}

    gotoAndStop (2)

    }

    This part of the code it goes to 2nd part of the scenario that it is and stop wich is a version of the origanal symbol breath

    I added a second order on structure 2

    blog.addEventListener (MouseEvent.CLICK.gotoblogpage);

    function gotoblogpage(evtobj:MouseEvent) {}

    gotoAndStop ("blogframe")

    trace ("the blog button has been clicked")

    }

    I have named the blog of symbol and use the name from where will the blog page to be "blogframe" this line of code at the bottom is where I run trouble the window output in Flash says "blog button has been clicked" I like it. no errors are accouring why that which is at the playhead does not attend the image "blogframe"? If the button does not work when I click on it the code is correct, I think the problem here is he does not want the read head go to the section I want it. So I gues, my question is, how can we make a button less, a clip interact with the main timeline?

    One way to do this is to target the root timeline...

    MovieClip (root) .gotoAndStop ("blogframe");

  • Targeting of evil to a button on the main timeline for a VideoEventComplete at work

    I have a .fla file that has buttons on the main timeline that target frames in a mc named 'pages' in a table.  The 'pages' are implemented in the form of frames each five images or as a slide show where the buttons advance or return to the previous page.  I want to make invisible buttons until frame 30 video is complete (page 4).  When I insert the code below in the main timeline, the button becomes invisible, but there is no event that will finish to come back only to show the button so it sits right there with no way to advance as the buton is invisible,

    Then... How to target the button to only be invisible when it has an event video complete but not not start before 30 (page 4) image of the mc and then do it again in the 35 framework etc.

    I tried to put it in the main timeline and on the frame of the first video.  If I'm on it within the pages don't need to point the code on the main timeline to get code know where are the buttons? Something like main_timeline.nextbtn etc... ?

    The code in the settings:

    Stop()

    Import fl.video.VideoEvent;

    THIS BUTTON IS LOCATED IN THE MAINTIMELINE\\
    nextBtn.visible = false;
    addEventListener (VideoEvent.COMPLETE, doNextFrame);

    function doNextFrame(e:VideoEvent):void {}
    nextBtn.visible = true;

    pages.nextFrame)
    }

    All the code is:

    THE CODE of the MAIN SCENARIO is:

    Listeners of button

    import of flash.media.SoundMixer;// it comes to the


    nextBtn.addEventListener (MouseEvent.CLICK, nextSection);
    prevBtn.addEventListener (MouseEvent.CLICK, prevSection);

    ///////////////////////////////////////////////////////////////////////////

    function nextSection(event:MouseEvent):void {}

    var thisLabel:String = pages.currentLabel; Gets the current image under chain tag
    var thisLabelNum:String = thisLabel.replace ("sct", ""); cut the main letters off the number
    var curNumber:Number = Number (thisLabelNum); Converts this string to a real number number
    If (curNumber < 18)

    {

    var nextNum:Number = curNumber + 1;
    pages.gotoAndStop ("sct" + nextNum);

    }

    SoundMixer.stopAll (); Place it inside your functions

    }
    ///////////////////////////////////////////////////////////////////////////
    function prevSection(event:MouseEvent):void {}

    var thisLabel:String = pages.currentLabel; Gets the current image under chain tag
    var thisLabelNum:String = thisLabel.replace ("sct", ""); cut the main letters off the number
    var curNumber:Number = Number (thisLabelNum); Converts this string to a real number number
    var prevNum:Number = curNumber - 1; subtract 1 from the number, so we can go to the next image tag
    pages.gotoAndStop ("sct" + prevNum); This allows us to go to the previous image tag

    SoundMixer.stopAll (); Place it inside your functions


    }

    Please Note: it started in a previous discussion, but I think that I was confused that the question so go fresh here, thank you so much for the time on this

    I can't say I'm immune to be confused by the story you tell, but I'll take a stab to offer what could be a solution.  If the buttons are in the main scenario and the code that you want to make visible with in a movieclip which lives on the main timeline, then you can target the buttons from inside and using movie...

    MovieClip (parent).nextBtn.visible = true;

    MovieClip (parent).prevBtn.visible = true;

  • Problem with Play Pause AS3 button on the main timeline

    I was wondering if someone can help with this? Have tried to create a play/pause for the main timeline button in my flash movie.

    Created a clip with 1 frame - a chart of the break, and then on the 2nd frame - game graphics, labeled 'pause' and executives 'play' consecutively and put a stop action on the first frame of the movieclip.

    Then put the following code in the layer actions on the main timeline (and gave the name of "ppBtn" instance of movieclip):

    var pp:Boolean = true;


    function ppState(event:MouseEvent) {}

    {if (pp)}

    Stop();

    event.target.gotoAndStop ('pause');

    pp = false;

    } else {}

    Play();

    event.target.gotoAndStop ('play');

    pp = true;

    }

    }

    ppBtn.addEventListener (MouseEvent.CLICK, ppState);

    He works at the stopping and starting of the film but the real movieclip is not switch between the break and the game graphics (a few stays on the framework - 1st of 'pause' State). Any help in this very appreciated!

    Thank you

    What answer was helpful (correct)?  Could mark you?

  • How to remove a function on the main timeline in a clip

    How to remove a function which is coded on an image of the main timeline of a clip?  I tried this, but no dice:

    infoGraphicDisparity.addEventListener (MouseEvent.CLICK, fl_ClickToGoToScene);

    function fl_ClickToGoToScene(event:MouseEvent):void

    {

    parent.removeEventListener (Event.ENTER_FRAME, parent ["enterFrameHandler"]);

    MovieClip (this.root) .gotoAndPlay ("disparity");

    }

    It's the event that I am trying to remove:

    stage.addEventListener (Event.ENTER_FRAME, enterFrameHandler);

    any help would be appreciated as always.

    Thank you!

    any image (which runs after enterFrameHandler is defined) in any display in the display list object

    stage.removeEventListener (Event.ENTER_FRAME, MovieClip (root) .enterFrameHandler);

  • Targeting the main timeline of in a MC

    Hello all, I have this project that basically works like a slide show. I'm doing things common sense and avoid scenes so I am building each slide as a separate and then mc placing them on the main timeline. What I'm trying to do is get the playhead to move forward on the main timeline to the next image once the mc reached its last picture. I found code that works, but it looks pretty ghetto:

    var _root:MovieClip = MovieClip (root)

    stage.addEventListener (Event.ENTER_FRAME, Text2);
    function Text2 (myevent:Event): void {}
    _root.gotoAndStop ("slide2");
    }

    I guess I have two questions:

    1. What is the right way to target a frame on the main timeline of in a mc in as3?

    2. the way I do build does make sense, or is there a better solution?

    Thanks for reading!

    This code is an accident waiting to happen.  An ENTER_FRAME event is raised repeatedly, at the rate of the file.  This does not mean that it looks like... such As... When something enters a ' framework' everything you need instead of this code is to put the following line in the last image of the mc...

    MovieClip (root) .gotoAndStop ("slide2");

    Since you asked on 'clean'... children should not talk back to their parents and tell them what to do.  The good news is that they should be independent and care only for doing what they do. It is the parent to keep an eye on the kids if they are so trend.  The only thing they should do is to know when they are made to the world the fact.  This is done by sending an event.

    If what you're doing are implemented the child to dispatch an event to indicate that they are doing what they are doing (in the last image in your case).

    dispatchEvent (new Event ("imDone"));

    and set up a listener for this child object in the parent of the parent timeline to listen to this event...

    childName.addEventListener ("imDone", eventHandler);

    function eventHandler(event:Event):void {}
    gotoAndStop ("slide2");
    }

Maybe you are looking for