Skip navigation
MetawebAU
Currently Being Moderated

Flash won't stop looping

Feb 28, 2011 9:37 PM

I have imported a 4 second SWF into Captivate 4. I want it to play through once then stop on the last frame of the SWF. The SWF has a stop embedded on the last frame. The problem is; it won't stop, but keeps on looping right through the SWF stop. I tried placing a 'Next' button with a "Pause after n seconds" on it and used varying intervals from 1 to 5 seconds for the pause to take effect but, you guessed it, the SWF just keeps on a-rolling along. The screen does stay put and does not continue until the 'Next' button is clicked - but I'm trying to get the SWF to play nice, and it won't!

 

It seems to be the opposite problem to this post > http://forums.adobe.com/thread/607598 where they want to keep it looping, but it stops instead. Unfortunately there's no answer in this post so I can't reverse engineer a solution!

 

Caviat: A colleague created the swf to my spec and I'm assuming they did in fact put the stop where requested. Will post an update if they did not do this.

 
Replies
  • Currently Being Moderated
    Feb 28, 2011 11:31 PM   in reply to MetawebAU

    Ask your colleague what version of ActionScript they published the SWF to. AS3 or AS2.

    The AS version must match the one in your Captivate movie.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 1, 2011 6:15 PM   in reply to MetawebAU

    Your mismatched timing might be due to the frame rate of the Flash SWF not matching the frame rate of the Captivate movie.

     

    Check with your Flash developer again to find out what the frame rate was (e.g. 30 frames per second).  Get him to match it to the Captivate project.

     

    The issue with Flash animations needing to be on the main timeline has been documented before in these forums.  It wasn't an issue in Cp4 but has become so in Cp5 because the new architecture actually loads all the animations at the beginning of the movie. This means that by the time you reach the slide where you want the animation to play, it's already played long before.  This only affects SWF animation that have buried the animation inside a symbol, which is what Flash developers often do to make it all easier to resize and reposition as needed.  When the animation is happening one level down from the main timeline, you can trigger this animation to work properly in Captivate 5 by using some ActionScript in the Flash animation's main timeline.  Here's how:

     

    1. Create your animation as a symbol on a single keyframe so that the animation happens on the level one level down from the main timeline.
    2. Give the animation symbol an instance name (e.g. Fred).
    3. Add a new layer to the main timeline for ActionScript.  You're only going to need two frames on the main timeline with keyframes on each one.
    4. Put a stop(); action on the second frame so that it stops the main timeline.
    5. On the first keyframe put this code or similar: Fred.gotoAndPlay(1);

     

    What happens here is that when the Captivate SWF loads it will load your animation and start playing it but it will be stopped at the second frame of the main timeline.  When it gets to the slide where you want it to play, it will begin playing again, hit the first frame and then the AS code there will tell the Fred animation to play from its first frame. Hopefully there will be a stop action on its own timeline to terminate it as well.

     

    I've had to use this trick several times when trying to use the Right_Mark and Wrong_Mark tick and cross SWF animations that come with Captivate 5.  They've obviously not been updated to work properly since the change from Cp4.

     

    Hope this helps.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points