Home AMX User Forum AMX General Discussion

Stopping an animation from a button press

Does anyone know how to stop an animation in mid animation? In other words, I have an animation running continuously but would like to stop it when the user hits a button. I cannot find any way to do this. I don't want the image to disappear, but I would like it to stop running through its animation and display the image it happened to be showing when the user hit the button.
Thanks,
Paul

Comments

  • viningvining Posts: 4,368
    I don't recall if you can do that w/ the ^ANI command but you can do what you want by what I suggested in this thread:

    http://amxforums.com/showthread.php?t=3019

    Just to reiterate you need to create a time line that that repeats at the rate you want to change your images. Create a time line event that increments a local variable that starts at one and increments to the number of image and then returns to one. NOw on every time_line event send a level to your TP (variable is the level value). When you want to stop just stop the time_line. When you wnat to start then start the time_line. If you want a blank image when not in use add an extra blank image state that's outside of the incrementing variable and then call that state by sending a level when ever you want providing you first stop the time_line. Your TP button needs to be set up as a Multi-State bar graph with the number of required stated. Set the range low and high to correspond to the number of images.
  • a_riot42a_riot42 Posts: 1,624
    Thanks I hadn't thought of doing it through a TL. Like someone else mentioned it transfers control to the processor which I would rather not keep busy doing these types of things but it may not matter that much since it is just sending a level. I will give this a try.
    Many thanks!
    Paul
Sign In or Register to comment.