#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    1
    Rep Power
    0

    Movie clip is skipping to the end on first play


    hey, folks, I'm hoping you can help me out. I want something to slide off the screen when I click on it. I (think I) have it set so that when you click, the button itself disappears, and a movie clip of the object sliding away becomes visible and plays.
    Code:
    mcslide._visible=false;  
    
    slidebutton.addEventListener(MouseEvent.CLICK, Click);
     
    function Click(ev:MouseEvent):void
    {
    mcslide._visible=true,
    slidebutton._visible=false);
    }
    The problem is that the movie clip will either skip right to the end and stop if I have a "stop();" put in at the last frame, or it will skip right to the end on the first play, but then loop correctly after that if there's no "stop();". Any thoughts? Thanks!
  2. #2
  3. No Profile Picture
    Gotta get to the next screen..
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2003
    Location
    Legion of Dynamic Discord
    Posts
    6,678
    Rep Power
    3164
    Hi, within the sliding animation you should put a stop action on the first keyframe and a gotoAndStop(1) on the last. Then change your code to this:
    Code:
    function Click(ev:MouseEvent):void
       {
          mcslide._visible = true;
          slidebutton._visible = false;
          mcslide.gotoAndPlay(1);
       }
    Quis custodiet ipsos custodes?

IMN logo majestic logo threadwatch logo seochat tools logo