Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Senior Member DesignBox's Avatar
    Join Date
    Apr 2004
    Posts
    340
    Member #
    5659
    I have some actions in flash that trigger a certain animation in a certain movie clip.

    The thing is, when I click on the button with the action i only want that animation to play once. So, right now if you click it again and again the animation will go back to the begining and start playing from the begining. Is there any way to stop this?

  2.  

  3. #2
    Senior Member
    Join Date
    Mar 2004
    Posts
    241
    Member #
    5465
    I think I understand the problem. You have an animation that when onclick starts playing to the end where theres a stop. Right now, your code is something like onPress > gotoandPlay(2); of the animation, so everytime the person clicks it plays, and you only want it to play once.

    The first solution I would have is instead of making it gotoandPlay(2); or whatever it is, make it nextFrame; Have a stop on the first frame obviously and also have a stop on the last and second to last frame. The last and second to last frame will be identical, and the animation would stop on the second to last frame. The last frame would have actions of gotoandStop(secondtolastframe). So, if the user does click it another time, it would go to the last frame, but automatically be put back the second to last one...hope you follow that.

    The other method I dont have completely figured out, but would be something like this. You call out another variable in the button, say clicks. On each onPress, say Click = click - 1 then, when the user presses the button, you first check to see if click is > 0, then gotoandPlay(2); or whatever.

    I think the first way would be a lot easier though.

  4. #3
    Senior Member DesignBox's Avatar
    Join Date
    Apr 2004
    Posts
    340
    Member #
    5659
    ok, I got a bit confused but I'll read it again thoroughly

    Thanks for your help, I'll try the first solution.

  5. #4
    Senior Member
    Join Date
    Mar 2004
    Posts
    241
    Member #
    5465
    Try this, I had to use the second way. The first way for some reason would only play one frame...anyways, take a look at this. I think it's what your going for:
    http://www.mime.eng.utoledo.edu/~mhe...buttononce.htm
    http://www.mime.eng.utoledo.edu/~mhe...buttononce.fla

  6. #5
    Senior Member DesignBox's Avatar
    Join Date
    Apr 2004
    Posts
    340
    Member #
    5659
    Yeah, that is what I wanted! Thank you

    EDIT: I just took a look at the .fla file, it seems really simple after all.

  7. #6
    Senior Member
    Join Date
    Mar 2004
    Posts
    241
    Member #
    5465
    Glad I could be of help


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:42 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com