Animation - replaying an animation

Hey everyone,
I've written an application with an animation using the Timer object. In order to stop the animation I call the stop method of the Timer class. From what i've read this just pauses the timer. My problem is that if i display the animation once it displays well. However, if i try to run the animation again nothing happens. I'm running the animation from a different class and have tried instantiating the animation class again but it still doesn't start the animation again. Any ideas would be great.
Thanks!

juxD wrote:
Hey thanks for your replies.
I'm using javax.swing timer. Basically my animation is of fireworks so what I do to create the fireworks effect is draw a lot of colored dots on screen moving outwards initially increasing in size then decreasing into nothing (i.e. disappearing). So as such i'm not using frames. When i initialize the animation, its meant to set the starting positions of the dots, then when the timer fires, the new coordinates and size of the dots is reset. Not sure if you're understanding - can post the code if it helps.Then in your case, the "counter" is really the whole state of the fireworks model, meaning the positions of the particles, their size, and whatever else defines how they're drawn each time. To start over, you have to reset all of that back to it's original state, just like it was when it started for the first time.
A simple way to do that is to take the code in the constructor that initializes the fireworks, and put it into a reset method, which you can call both from the constructor, and whenever you need to restart the animation.

Similar Messages

  • In Flex 3 how to Stop and Replay .swf animation created in Flash

    Hi
    I have an animation file that is created in Flash (I think
    CS3). In Flex if I import it inside a SWFLoader or if I import it
    as an Image. It plays once and stops. Then I can not replay it. I
    also can not pause it when its playing.
    I have tried few things based on help and code available in
    the Web to of no help. I have tried to convert the swfLoader
    instance to a movie clip like so to stop
    var c:MovieClip = swfLoaderHeaddress1.content as MovieClip;
    c.stop();
    <mx:SWFLoader x="53" y="116" width="206" height="255.3"
    visible="true"
    source="assets/animations/curatorial/ZoomHeadress_2nd.swf"
    id="swfLoaderHeaddress1"/>
    It does not work.
    I have not created the .swf animation, I am not sure how it
    is done. I belive it may not be using any ActionScript as I know
    the artist who created it does not know ActionScript. Does
    something need to be done inside the Flash to support the stop and
    play? Or is there a way to restart/replay stop a .swf animation in
    Flex 3 no matter how (and whether or not its developed using
    ActionScript) its developed in Flash?

    One way is she has to add some AS code to the animation, or
    you can do it yourself.
    In swf there must be something like this:
    var connReciever:LocalConnection = new LocalConnection();
    connReciever.client = this;
    connReciever.connect("fromFlexToSWF");
    function myFunction(parameter:SomeClass):void {...}
    And in Flex:
    var connSender:LocalConnection = new LocalConnection();
    connSender.send("fromFlexToSWF", "myFunction", [..args]);
    The other way: in case with just play/stop there is a way to
    resolve this by using that Flex Component Kit (or maybe "Flex Skin
    Design Extension", i do not remember), it is something like she
    just adding labels to animation frames then she exports it with
    Flex Kit and then you can work with it like with an object with
    "states".

  • How to replay entire composition including video and other animation in edge animate cc 2014.1

    I am working on a project but i am stuck now. The basic flow of my project is: intro slides then a video plays then next and back buttons fade in that will control the next set of slides. Another button to replay the whole thing from start. My problem is i am able to replay the slides but not the video. My slides consists of text animations. I am using  the new edge animate cc 2014.1 All the slides play from the beginning but the video does not follow that lead. I also managed to replay the video but thats not the desired thing i want. I want the whole composition to play again when i click a button. Can anyone help ?

    The problem is with the playReverse call for time duration in which video is there.
    playReverse actually plays in timeline in revere order 5sec->4sec->...->0sec, but this won't work for video as it doesn't play the video in reverse.
    what you can do is that, in the "previous" button click handler, add
         if(sym.getPosition() > 7750) {
           sym.playReverse();
         else {
           sym.$("trance6")[0].pause();
           sym.$("trance6")[0].currentTime = 0;
           sym.play(0);
    Also in "start" button click handler there needs a correction as below:
         Use this sym.$("trance6")[0].play();
         instead of sym.$("trance6")[0].play("1");
    hth,
    Vivekuma

  • Replay Button for SWF animation

    Situation: Imported animated SWF file into slide. Using
    Captivate Back and Next buttons to control navigation. I want to
    add a "Replay Demo" button for the animation SWF file.
    Is this possible through Captivate (or Flash)? I don't want
    the continuous loop animation but do I want the option for a user
    to review animation again if desired.

    I hate it when I post something on a forum and then I
    discover the answer 10 minutes later. Ny your answer I'm guessing
    the Captivate add button fweature with a Jump to slide 1 setting"
    is the answer, right?
    That DID fix the replay issue. Now on to second issue. The
    animation blanks out once it finishes playing. While looking for
    the replay answer yesterday, I noticed a post that said something
    about creating a screen capture of the last slide and insert it on
    the timeline or something... back to searching. Thanks for the
    quick reply.

  • How to replay animation interactively

    For example I have some animation being played and stopped at some point. I want to click smth on screen to replay it again. What are my best ways to do it?

    ok let' start from the beginning)
    I make animation in Adobe Edge and put it into Indesign for further work
    I use same technique as described above (sym.getSymbol( <yourAnimation>).play(0);)
    for several animations in children book
    In 6th animation suddenly I have this error   (unexpected token illegal) - in 10th row of code as parser says
    my question is - what is the error and how to fix?
    that is a full part of code:
    var onoff = true;
    if (onoff){
    // play action
    onoff=false;
    }else
    // stop action
    onoff=true;
    }//set the value of a Symbol variable
    sym.setVariable("//get the value of a Symbol variable
    var myVariable = sym.getVariable("myVariableName");
    ", "variableValue");

  • How to replay( looping ) a movie clip which animated by action script?

    My movie clip has only one frame, I animate it by using
    action script.
    How can I looping its animation?

    quote:
    Originally posted by:
    dzedward
    if you're using the Tween class, listen for onMotionFinish
    (as2) or MOTION_FINISH (as3) to start the tween over.
    no, my movie clip was animated by using for loop. What I want
    to do is no matter where I put my movie clip, it will contnuously
    move from left to right.

  • Stuck at startup - K1 constantly replays Lenovo animation

    Hi everyone,
    This just started happening this evening.  Is there any way to reset the K1 without going into the settings?   I haven't installed any new apps or updates for over a week.  Any help would be appreciated.

    Let's not try to scare him away There are some problems, but by in large the k1 has been a pretty good tablet (apple alternative) for me thusfar. I personally am not interested in sending my unit off to Lenovo for this type of repair (boot failure). Can't hurt try try and resolve on his own before giving up. If its caused by hardware that would be a different story, but I'm willing to bet his is another software related failure.
    I still feel the k1 was a good value for the low price I paid. I carry an iPhone but cannot justify the expense of the iPad. More refined, sure, but no hardware is without its fault. Same can be said for software.
    Thanks,
    Ricochet
    The K1_Was Just A Broken Promise Lenovo

  • Creative Zen MicroPhoto/animated GI

    [color="#6633ff">Hey, you guys, I was wondering if Creative Zen MicroPhotos[size="3" color="#6633ff"> are compatible with animated GIFs. They classify as a really short video for me. They're still pictures, but it's like a small scene that replays over and over. I found one of Napoleon Dynamite dancing, and I would love to have it as my player's background!
    Thx.
    <3 ya!
    Message Edited by bluezmplover on 03-28-200605:3 PM

    Nope, don't think so.

  • Flickering screens during animations

    I get multiple flickering white horizon zaps across my screen whenever there's an animation playing. This happens in Safari, on certain pages with animations and in iMovie whenever an animated effect is preveiwed, but not when the effect is applied to the clip and replayed. Neither does it happen during 'normal' use, nor during dvd playback. The breaking up of the screen is quite severe and not a little alarming!
    Does anyone have any ideas what might be causing it and whether there's a fix?
    I have 2 crt's running at 2048x1536,
    the video card is the nvidia 6600

    Hi Naga,
    There is no need of customization. For most of the transaction SAP behaves the same way. But instead of using BDC you can go with BAPI's e.g. BAPI_SALESORDER_CREATEFROMDAT2
    Thanks,
    Mandar

  • Why would some animated gifs loop some not? (all do on other browsers)

    Hello. I have 2 different animated gifs on the site I'm building with Weebly. One of them is a loop which works just fine. The other gif is made to just happen once. However, it will not replay when its page is refreshed or revisited (it does replay on other browsers). So I'm wondering what can be done to fix this. The page is http://www.backeze.com/about-us--contact.html
    Thanks very much for your help ~
    Les

    Yes, its there. Also, when I right click on the image and select VIEW IMAGE INFO it will replay. thx

  • *Flash animation looping but going back to first frame {want to hold on last frame}

    I came across this article on looping animations = http://www.quip.net/blog/2006/flash/how-to-loop-three-times
    I'm a novice with flash and just trying to plug thru to get some ads up and running for the first time.
    Everything worked for me in the article...the one thing I wanted to do but haven't found an answer to is how to stop the animation on the last frame after looping is complete, instead of automatically going back to the first frame??
    What's the easiest/most effective way to do this?
    The stop script does not work...still goes back to first frame.
    For all my flash ads, I've imported an FLV video...so don't know if it's some function for flv's/video's that auto-rewinds to first frame...
    Thanks so much, really appreciate any insight on this.
    The sooner you can catch a minute to get back the better

    Ok...not working for me - prob. b/c I'm missing something again.
    What I did was...
    1)  Renamed the instace of replay button = "replay_btn".
    [not sure if that's correct...guessed b/c you reference it in the code]
    2)  I placed this in the action code on action layer on last keyframe =
    var loopNum:Number;
    loopNum++;
    if(loopNum%3==0){
    stop();
    your_replay_btn._visible=true;
    } else {
    your_replay_btn._visible=false;
    3) I placed this in action code on the replay layer on last keyframe =
    your_replay_btn.onRelease=function(){
    this.gotoAndPlay(1);
    What happens is the replay button still flashes at the end of each loop and the loops just continue...it doesn't stop at 3.
    I also get this error =
    Can you break down what I'm doing wrong and how to fix...need to get this out asap.
    I truly appreciate your help and time so far on this...big thanks kglad!

  • Controlling animation with the movement of a mouse

    I know there are ways to control videos and swfs with the actions of a mouse in Flash Catalyst. But how can you set it so that the swf animation will go back and replay from the beginning once the mouse moves anywhere on the trigger? My animation plays once on rollover (which still does not suffice) but then stays on the last frame when I try to trigger it once more. Any Ideas?

    I'm actually curious about an answer to this question as well. I have rollover slidelets that will expand a tab when activated, but once the rollover has been completed, and a users mouse leaves the rollover area, it does not return to the original state, but instead the tab remains expanded. Is there any way to return an object to its original state once the mouse leaves the rollover area?

  • Non-looping animated gif issue....

    Hi, I have an issue with animated gif files where they do not replay correctly when I return to the slide that contains them. They play fine the first time viewed, but not if you return to it. It seems the only way I'm able to keep the gif playing is if I set it to endlessly loop. And if I do that, the animation doesn't start from the beginning when I return to the slide. I just want the animation to start over and play from the beginning once every time I go back to the slide.
    My animations were made in Flash and exported as gif animations. I'm using Captivate 7 and my client needs the course to be all HTML5 (no Flash).
    Has anyone been able to get a animated gif (not set to loop) to play correctly (meaning from the beginning of it) if you return to the slide after viewing it already?
    Thanks,
    Dan

    Hey Rick, thanks for your reply. I liked you idea and had hope, but I tried this and it had no effect. What I have figured out from testing however is that if I go back 1 to 5 slides and return to the animation slide it doesn't reset and just shows the last slide of the animation only. But if I go back 6 or more it does reset the animation. That's very strange! I tested this several times and got the same result. I wonder if there is a buffer of memory of some sort that drops slide info after 5 slides? Or something stranger?

  • How do I start/stop a slide's animation?

    One slide of a slideshow I'm making I want the animation to end after it's completed without looping.  I can do this by adding the stop(); command into the last frame of that slide, but if I return to that slide, it will remain in the end position instead of replaying.  Is there anything I can do about this?

    When I start up Flash, there's a box immediately to the left of the workspace.  It doesn't actually have a title, but has a + and - at the top.  Inside the box, there's a thumbnail with the word "presentaion" next to it.  I right click on that, hit "Insert Screen", and a box appears under it branched out with the basic name of 'slide#'.  These slides are what I'm making my slideshow across.
    The buttons in my slideshow advance to the next slide, seemingly the exact same function as the left/right arrow keys.  I didn't actually code it myself since I don't understand Actionscript too well yet, I used the Behaviors window and selected Screen > 'Go to Next Slide' (or Prev Slide).  The code that it generated for the Next Slide Button is:
    on (release) {
          // GoTo Next Screen behavior
          var screen = null;
          var target = this;
          while((screen == null) && (target != undefined) && (target != null))
            if(target instanceof mx.screens.Screen)
              screen = target;
            else
              target = target._parent;
          if(screen instanceof mx.screens.Slide)
            screen.rootSlide.currentSlide.gotoNextSlide();
          // End GoTo Next Screen behavior

  • Animated Flash Buttons Not Working Right

    I'm updating my website and my menu buttons have an animation on the mouseOver. A simple animated button with the "Up", "Over", "Down" and "Hit" keyframes.
    www.brenda-nies.com will show the effect of my menu buttons and the effect I want to keep. Part of my updates are switching to AS3 and that's where my problem comes in. You can't see it on the website I gave you, but in my working file, when I test it (in IE8), everything starts out fine when I first rollover my button, the animation runs through it's cycle and stops. However, if I press down on the mouse button, the animation starts over. The same when I release the mouse button, the animation starts over. I want the animation to run through 1 cycle and stop, then stay stopped until I roll off the button.
    Does anyone know what I'm doing wrong....or not doing?

    I appreciate you help, you helped me on another question before as well. However, for this particular question, I'm am already doing what your saying, at least I think I am.
    I've attached a screenshot below of what I currently have. The first layer, is all text, so...the "About Me". The second layer is my animation. That blue and black bar is actually hidden behind that grayed out "black and wood" area. That blue and black bar is also the "Button_Bar" layer in my timeline. When I rollover "About Me", that blue bar rises up and the edges fade. That all works fine and dandy. However (and I'm sorry if I'm repeating), let's say I want to go to the "About Me" section. When I click "Down" the mouse button, the animation starts over - the blue bar disappears for a split second and rises up from behind that aforementioned area. The same when I release the mouse button - the bar disappears for a split second and rises up. And I have to mention that not once did I roll off my button, yet the animation replayed with each mouse event.
    I thought maybe it was my file so I did a test and started fresh with a brand new document. Same thing is happening. I don't have any script, except for the stop script in my movie clip. Should I be using some kind of script?
    As for the movie clip, I created it using a shape tween. I also don't want anything in the "Up" state.

Maybe you are looking for

  • SSO not accepting username and password after session timeout

    Dear Charan, We have the same issue after ATG upgrading from 12.1.1. to 12.1.3, Users are facing the same error. Error:  The application you are trying to access requires you to sign in again even if you have signed in previously. Sign In I have set

  • Apps won't sync from computer to iPhone

    Hi there, Earlier this week, I followed the instructions in this thread: Syncing to a "New" Computer or replacing a "crashed" Hard Drive ...to change my sync computer from my iMac to my Macbook.  It seemed to work okay.  I can connect my iPhone 6 to

  • How can I save transparency/inner glow effects when exporting to jpg?

    I'm very new to InDesign. I increased the noise levels in inner glow in 'Effects' to create a textured look to my document (I wanted a paper texture and found this method on Google) but when I exported to pdf or jpg, I realized that my transparency e

  • Hyperion Planning Data Source Configuration Error

    Hi, I'm trying to configure Planning. I'm at the last step of the configuration utility, and trying to configure "Data Source Configuration" for Planning. When I try to do it, I Create the Datasource, I give the Datasource name, and I select the data

  • Beginner Question - How do I amke frames size 320x240 ?

    I am trying to make a student project using QT movies which are 320 x 240 pixels. I want to string them together with some edits, titles and text but not change their size. Then save them back to a Quicktime movie the same size. But when I drag 2 mov