Button in movie clip linking to next frame

I've included a button in a movie clip on frame 1 of the main
timeline. The button has a motion tween that ends on frame 76 of
the movie clip. I want the button to link to frame 2 on the main
timeline. However, when I test the movie, it cycles endlessly
without stopping at the end of the movie clip to allow the user to
click on the button.
Here's the AS3 code I put on the Actions layer on Frame 76 of
the movie clip:
stop();
link_btn.addEventListener(MouseEvent.CLICK,link_btnClick);
function link_btn(event:MouseEvent):void {
gotoAndStop(2);
Any ideas? It's for school and I need it done tonight or
tomorrow morning by 8 a.m. Central. Yikes.

I'm getting compiler errors S1061 and S1120 attached to code:
link_btn.addEventListener(MouseEvent.CLICK,link_btnClick);
S1061:
Call to a possibly undefined method addEventListener through
a reference with static type Function.
S1120:
Access of undefined property link_btnClick.
I don't know what the errors mean. Anybody?

Similar Messages

  • Buttons in Movie Clips, Movie Clips in Movie Clips

    Here goes. I have a scene with a button in the timeline, that
    targets a frame in a movie clip, which is essentially the content
    area of the layout. this is the code used:
    on (release) {
    textmov.gotoAndPlay ("challenge");
    This works fine and dandy. Now the problem. Within this
    "Content" movie clip, i have another movie clip with a button in
    it. This clip is designed to tween in then upon clicking a close
    button tween out. When I test it the button doesn't have rollovers
    like and I can't get it to talk to the clip above it to play the
    close tween.

    > I am still struggling with the fact, that upon testing,
    buttons in movie clips
    > do not exhibit their various states. Up, Over etc. I'm
    relatively sure that you
    > can have buttons in Movie Clips. I've also noticed that
    any graphic symbols
    > within a Movie Clip produce the hand, when the mouse
    cursor is Over them, just
    > like a button would. All of this happens, when testing
    in the FlashPlayer.
    is there any place you could kindly upload the source file
    for me to check ?
    > Do buttons operate independently of the Movie Clip
    timeline they are placed in?
    that is correct, button should work independently to movie
    clip.
    it only react to mouse upon entering the HIT state (which is
    invisible to user)
    and stops reacting once the mouse is off that state.
    > I have one Movie Clip with a one frame time line, should
    a Button symbol work
    > it it?
    of course it should work...
    Try to upload the source, let us check it out for you, spare
    you time on guessing :)
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Buttons in movie clip won't bring up scenes

    I've created a movie clip within my main scene.
    I have 6 buttons in that clip. I would like these buttons to
    call up the appropriate scenes but it isn't. I don't know whether I
    cannot have buttons in movie clips call up new scenes or if my
    actions script is simply wrong.
    Here are some of the actions I've tried to upload the scene
    or swf files:
    thanks.
    on (release) {
    _root.gotoAndPlay("instance name");
    ----Also, named 1st frame of scenes with matching instance.
    on (release) {
    _root.gotoAndPlay("scene name");
    on (release) {
    gotoAndPlay("scenename",1);
    on (release){
    uploadMovie ("name.swf",1);
    }

    use frame labels only and use the goto methods (like your
    first 2 goto statements) and not the goto functions (like your last
    2 goto statements).
    also, there is no uploadMovie() method in actionscript. use
    loadMovieNum() if you want to load name.swf into _level1.

  • Needs help adding images to movie clips and referencing the frames

    i havent started with a blank, script made movie clip.
    I want to add frames from action script 2, and be able to
    reference/show the induividual frames for a video game and not a
    movie. I dont realy need animation, i just need certain frames to
    show, that i want to load load(from a non script made movie clip
    with one loaded frame(bitmap data).

    you can't add frames to a movieclip using actionscript. so,
    if that's what you're trying to do you'll need to find some other
    way to accomplish your goal.

  • Button Movie clip link

    I've created some simple buttons that I'd like, when clicked,
    to play a movie clip. Whats the best way to do this?

    This is what I came up with and it seems to work... can this
    be refined and improved on?
    For example, what if I want it to return to its original
    value when clicked a second time?

  • Advanced Button with Movie Clip and Fading

    Problem: I'm trying to create a bottun that when you roll
    over it it plays a movie clip and also fades in and out on roll
    out. It is similiar to the three main navigating buttons on the
    following site.
    http://www.fjcruiser.ca/
    the buttons with the compasses that appear are the ones I am
    talking about.
    I already know how to make buttons, I just can't figure out
    the actionscripting to load the movie and also fade in and fade out
    according to roll over and roll out.
    Please help. Thank everyone.

    Amazingly, I actually know exactly how to do this. And it
    only requires about 4 lines of code in the _root layer and on the
    button.
    Instead of having the rollover load an external movie, you
    want the have the rollover execute an on(enterFrame) function that
    tells each newly entered frame of your movie to check to make sure
    the mouse is still on the button, and if not, send the movie
    playhead backwards.
    So, put that sampleMovie right on the stage with the button.
    Then write the code in the _root so that says: as long as the mouse
    is over the button, the movie will advance to nextFrame(). When it
    gets to the next frame, again the code checks to see if the mouse
    is on the button, if so, the movie is instruct to go one more next
    frame (which is tweening the fade, right?) again, over and over
    until the stop() at the last frame. But, if while while entering a
    frame, the code finds that the mouse is no longer over the button,
    it does the same thing but this time instructs prevFrame(), and so
    on, going prevFrame (backwards, in other words) as long as the
    mouse is not on the button.
    The result of the above is a gradual fade in and out,
    depending on whether the mouse is hovering. This, as opposed to an
    abrupt disappearing graphic on(rollOut).
    Click the below link for the .fla that demonstrates this
    technique (which, by the way, I learned from Joshua Davis'
    excellent book, "flash to the core". Check it out at Amazon, or
    wherever. Lots of cool tricks).
    click here for
    fade_Movie example

  • How do I create a play button for movie clip using AS3

    Hello.
    Bit new to this and have been searching the adobe forums and google. I am trying to create a button that will play an imported MovieClip.
    I have a movie clip that I've imported into it's own layer (Layer1) Frame 1.  I've given the MovieClip an instance name of foundationMovie.
    I've created a button and have that on its own layer(Layer2) above layer1, it is also in Frame 1.
    I've added a
    stop (); action to layer2
    The video is not set to autoplay.
    I want the video to start playing when the viewer clicks the button.  I know I've got to put some kind of event listener using AS3 in my timeline somewhere.
    I've found some code and I've been trying to work with it.  I'm sure I've mutilated it beyond usability but this is what I've got.
    stop ();
    player.addEventListener(MouseEvent.CLICK,play);
    function play(event:MouseEvent)
    gotoAndPlay("foundationMovie");
    If someone could point me the right direction or help me with my code I would really appreciate it.  Thanks.

    First, you need to clear up what you are working with... a movieclip and a video are usually entirely different things.
    Next, your code may get you started on your way with some changes.   You shouldn't use "play" as a function name due to there already being a play() method/function in Flash.
    If the movieclip is a movieclip and has an instance name of "foundationMovie", and your button has an instance name of "player" then the following adjusted code would normally work...
    stop ();
    player.addEventListener(MouseEvent.CLICK,playMovie);
    function playMovie(event:MouseEvent)
         foundationMovie.play();

  • Multiple click points for one button and movie clip

    I am trying to make a single button into a multiple click
    point. I have a movie clip on the stage and I have an invisible
    button over it. The movie clip consists of a single timeline that
    has an ambient animation running and looping intially. I have three
    more labeled sections of that timeline that each contain a
    different animated sequence as click point animations for that
    movie clip. I want the user to click on the button on the stage and
    the first labeled click point animation of that movie clip will
    play. I want that action to be stored so that when the user clicks
    again then the second labeled click point animation will play then
    they will click for the third in the same way. In between user
    clicks I want the ambient animation loop in the beginning of that
    movie clip timeline to play. When the user has clicked the 3rd and
    last animated sequence then the whole thing will reset and be
    available again. Can anyone let me know how that can be
    accomplished. I originally scripted it through tell target to play
    the first but I don't know how to move forward. Thanks!

    What version of Flash are you using? Telltarget is very
    old... try something like this:
    // array of the animations
    myAnims = ['firstAnim','secondAnim','thirdAnim']; // these
    are also frame labels
    // your current animation index in the array, arrays start at
    0,
    // so we start at -1 which is like before anything
    currAnim = -1;
    // function to play the next animation
    function nextAnim(){
    // add one to the current animation index
    currAnim++;
    // if you've reached the end of the array, start back at 0
    if(currAnim >= myAnims.length)currAnim = 0;
    // now tell the MovieClip to play based on the value of the
    current array index
    myMovieClip.gotoAndPlay(myAnims[currAnim]);
    Then on the button you just put:
    on(release){
    nextAnim();
    And at the end of each animation on the timeline, put:
    gotoAndPlay(1);
    And at the end of the ambient loop at the beginning I guess
    you have that, too, so it loops.
    Hope that helps

  • Deactivate a button until movie clip is complete

    I am creating several self study courses for my company's
    intranet. I added buttons for nextFrame and prevFrame to allow the
    user to navigate at their own pace. My problem is that a frame may
    include a movie clip that needs to play before the next button
    appears (or is activated).
    Thank you from an old dog trying to learn new tricks.

    Hello!
    Maby you could disable your button with this little script in
    the timeline:
    YourButton'sInstancename.enabled = false;
    That will disable your button.
    Enyways, if your problem is what I think it is.. you might
    reslove your problem by making the movieclip like this:
    Start by making a new movieclip. Name it as you would like
    it.
    In the first frame of your MC (movieclip) start making the
    animation with tween and whatever you want. When the animation is
    done, make a new layer INSIDE your MC and on the frame where your
    animation stops, drag in the button, or make something and convert
    it to a button. Make sure you have this script in the same frame as
    your button: stop() ; So, when the animation is finished, the MC
    stops at the button.
    After that, just type the script inside your button. Like
    ex.:
    on (release) {
    gotoAndStop("scene 1", 1);
    You have to change scene 1 to the name of your scene which
    you want to go to after clicking the button, and change 1 to the
    framenumber you want to go to.
    Hope this helps!
    Happy smile,
    SveinMikkel.com

  • 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

  • Buttons in movie clip don't work consistently

    I'm using Flash navigation in Dreamweaver. Most of the
    buttons work, except for a bunch that are in a movie clip. They
    sometimes load the right page, sometimes not at all. I'm using
    Flash CS3 and ActionScript 2.0.
    This is what I have on the buttons:
    on (release) {
    getURL("This is where I have the URL", "_self");
    }

    first and foremost. For testing, add a trace to your
    function.
    on(release){
    trace("The release is triggering");
    getURL("TheURL","_self");
    If this traces out when you test the movie, then you know
    that the release is getting triggered. If it does not, then it is a
    problem with the release not getting triggered.
    If it is getting triggered, then the problem is in the getURL
    statement. I would try _root.getURL(); to force the getURL to
    happen on the main timeline.
    If it is not getting triggered, then I may consider using
    timeline actions in the root timeline. To do this, give the
    movieClip that they are embedded in an instanceName, and give each
    button an instanceName. Then use code like the following on the
    first frame of the root timeline:
    myMovieClip.myButton.onRelease = function(){
    getURL("TheURL","_self");
    }

  • Buttons and movie clips

    I'm sorry if this question has already been answered. I
    searched the archives and couldn't find what I was looking for.
    Basically what I want to do is use a button to play a movie when
    pressed. The problem is I can't figure out how to do it.
    1. I've created 3 buttoms and three movie clips.
    2. I created a layer for the background which has text on it
    that says "press to view".
    3. I created another layer for the buttons and one layer for
    the button text
    4. I created an actions layer and put a stop action in frame
    1
    5. I added another layer for the movie clips on frame 2
    (mailflow_mc), frame 3 (reject_mc), frame 4 (fullrate_mc) and
    labeled each frame accordingly.
    6. Add action script for each button:
    on (press) {
    gotoAndPlay("reject");
    When I play the movie the animations will not load and they
    flash fast. Any suggestions?
    Thanks,
    Mimi

    if you have a frame labelled reject you can use:

  • How to _root in as3 (buttons in movie clip referencing to main timeline)

    Hi, I created buttons within a movie clip that i placed in the main timeline.I am  a novice to as3. I just wanted the button to go to the frame label of the main timeline. i used to do this with _root in the old flash. how do i do this?
    thumb02_btn.addEventListener(MouseEvent.CLICK, buttonClicked);
    function buttonClicked(event:MouseEvent):void
        gotoAndPlay("slide2");

    Thanks for the quick reply!
    somehow i must be doing something wrong though. It's not working...
    I added a stop to the "slide02" labeled section of the main timeline.
    and I also added a stop to the beginning and end of the movieclip. Am I doing something wrong? attached is my file....thanks!!
    stop();
    thumb02_btn.addEventListener(MouseEvent.CLICK, buttonClicked);
    function buttonClicked(event:MouseEvent):void
        MovieClip(this.root).gotoAndPlay("slide2");
    stop();

  • Button in movie clip! What to do?!

    Hello!
    I have a button inside of a movie clip timeline which I want to link to the main timeline, however, no idea how to go about it, I have tried all the usual coding but think i need to point it to the main timeline but don't know how.
    Please help.
    Cheers
    T

    Write the button code in the main timeline, targetiung the buttons via the movieclip's instance name.  That way you don't have to deal with interacting with the parent timeline.
    mcName.btnName.addEventListener.... etc

  • Nested Movie Clip Link Issue

    Hi All,
    First off, I am a noob to Flash and AS3, but have learned a lot over the last few weeks working on this project (http://www.jtapia.com/vcore/vcore_eng_up.html - go to COMPANY INFORMATION > PROCESS SUMMARIES to see the problem).
    My problem is I have a nested movie clip that houses a text URL link to a PDF file in another nested MC. The link works fine OUT of the parent clip but does not work when nested inside the clip. The odd thing is, I have almost the SAME exact thing in the navigation and it all works fine (except it isn't a URL link but I do use an event listener to look for MOUSE_OVER, etc).
    The only code refrencing the parent clip is:
    1) The fluid layout code (a stage event listener)
    2) At different stages in the main timeline, I adjust the nested timeline to various points in the nested clip (i.e. - MovieClip(mc_page_text).gotoAndPlay(2);  )
    Everything works great EXCEPT the URL links. The animations, everthing else works - no errors.
    I've been reading and searching for help on this for hours and can't find a solution. Any help is much appreciated!
    Thanks!
    Jake
    PS - if I left out critical info, please let me know and sorry in advance

    Hi kglad,
    There really isn't any code...the parent clip (main timeline) is on a stop(); frame - the link is via the STATIC TEXT properties box under OPTIONS > LINK. I think that is what's so confusing to me. The only other code is this (as I mentioned in the first post):
    the fluid layout code:
    function resizeListener (e:Event):void { //fluid layout code
    //    trace("stageWidth: " + stage.stageWidth + " stageHeight: " + stage.stageHeight);
        mc_page_text.x = ((stage.stageWidth / 2) - 258);
        mc_page_text.y = ((stage.stageHeight / 2) - 161.5);
        mc_logo.x = ((stage.stageWidth / 2) - 354.05);
        mc_logo.y = ((stage.stageHeight / 2) - 244);   
        mc_contact.x = ((stage.stageWidth / 2) + 132.95);
        mc_contact.y = ((stage.stageHeight / 2) - 239.7);       
        mc_nav.x = ((stage.stageWidth / 2) - 500);
        mc_nav.y = stage.stageHeight - 178;
        mc_footer.x = ((stage.stageWidth / 2) - 500);
        mc_footer.y = stage.stageHeight - 15.05;
        mc_bg.width = stage.stageWidth;
        mc_bg.height = stage.stageHeight;
        mc_fade_out.width = stage.stageWidth;
        mc_fade_out.height = stage.stageHeight;
    And these two references to the mc_page_text MC (the parent clip of the actual STATIC TEXT items) from the main timeline:
    MovieClip(mc_page_text).gotoAndPlay(2);
    MovieClip(mc_page_text).gotoAndPlay("textFADE");
    Thanks for the help!
    Jake

Maybe you are looking for

  • Installation of Photoshop update 13.1.2 for creative cloud fails with error code U44M1P7 I need help

    I need help installing update 13.1.2 for Photoshop creative cloud, installation fails with error code: U44M1P7. Could someone please help?

  • Can't get transitions to execute

    Hi folks, I'm building my first Flex app, which is a typical simple quiz. Intro state, string of questions, then a result. I'm stuck right now in that my transitions are not running. I suspect it has something to do with the fact that I extended the

  • Duty exemption pass book in IMPOT

    hi case is like this, I am using duty exemption pass book licence for clearing goods from custom because i am getting some exemption when i use this lience instead of paying rupees. first ,i create local PO against lience holder agent for lience ammo

  • SQL Query Not working

    Hi All, Please help with the error ORA-00923: FROM keyword not found where expected. I am trying to execute the following SQL query. SELECT CASE WHEN (Grouping("PRICECATEGORY"."PriceCategoryName")=1) THEN "PriceCatTotal" ELSE "PRICECATEGORY"."PriceCa

  • I need help activating bbm!

    my bb bold died tonight, so my friend gave me her storm to activate.  i received it, hooked up up to my comp to restore all of my contacts and proceeded to use it.  everything is working great, except my bbm contacts didnt transfer over, and it's sti