A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Stop looping and add replay button to an animation

  1. #1
    Junior Member
    Join Date
    Dec 2004
    Posts
    2

    Stop looping and add replay button to an animation

    Ok this is my first real flash project.

    I'm required to create a banner advertising a computer company. It has to be 10 seconds long. I'm doing fine with most of the project, BUT...

    What I really wanna do is have the animation stop on the final frame, instead of loop. This may be easy but I cannot work out how to do it.

    The second thing I'd love to get sorted is to create some sorta button or graphic that when clicked on, would replay the animation. I could be more to the point and just ask about how to create a replay button.

    Can anyone sort me out?

    I should maybe have posted this in the newbies forum, sorry
    Last edited by TatsuyAce; 12-29-2004 at 08:25 PM.

  2. #2
    It's a long way to the middle launchpad67's Avatar
    Join Date
    Oct 2004
    Location
    Prescott, Arizona
    Posts
    1,387
    To stop the animation, simply put stop(); on the last frame!
    To make a replay button, make a button and give it this script...
    on (release) {
    gotoAndPlay(1);
    }

    Then put the button on the last frame of the animation, where it 'stops'.
    Use this fla as an example.
    Replay Fla

    Mike
    Last edited by launchpad67; 12-29-2004 at 08:38 PM.

  3. #3
    Junior Member
    Join Date
    Aug 2004
    Posts
    21

    hey there...

    HI... what i 'd do, is in a new layer o top of your animation setting one key frame in the last frame (only one framelong) that contents an action: stop()

    This will keep your movie off form looping...

    The restart button is any button.
    At the last frame of your main movie..set another stop just like the one before...in that last keyframe set your restart button.. with:

    GotoAndPlay (1)

    That will do...
    hope it was useful

  4. #4
    Junior Member
    Join Date
    Dec 2004
    Posts
    2
    thanks for your help guys

    I assume your talking about scripting language, basically as im really damn new to flash I havent even thought about going into the code, but I know my html and visual basic so I'll start messing about with the code and hopefully I'll get it sorted.

    cheers

  5. #5
    It's a long way to the middle launchpad67's Avatar
    Join Date
    Oct 2004
    Location
    Prescott, Arizona
    Posts
    1,387
    Did you look at the file I posted? It's all in there. Open the 'actions' panel and look at the simple code. You'll get it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center