Skip to main content
Participant
March 1, 2008
Answered

Stopping external SWFs from playing

  • March 1, 2008
  • 1 reply
  • 429 views
Ok I'm fairly new to this AS 3.0.

I am in process of making my portfolio website.

I'm loading external SWFs into my my navigation page which will contain most of my content elements for the main page.
I've loaded in my header and it has some animation on it from the time line.
So it loads in fine and plays through the animation, but then it loops over and over and i want it to just play once and stop.

Is there a code that i can write up to make it play once?
It's not a movie clip within the SWF it's just some text that i have moving across the screen in a simple motion tween.
I was looking through my AS3.0 bible and it mentions being able to stop a movie clip by using something call onEnterFrame combined with goToAndPlay() and even stop().

But they don't explain it and I'm lost; they just show example code.
Should i convert it to a movie clip or is there a way to stop it the way i have it.
Please be detailed in any explanation you provide and use simple terms I'm still learning this AS code =/.

Thanks in advance!
This topic has been closed for replies.
Correct answer somascope
Are these Flash animations ones that you created? If you have access to the FLA files of your external SWF files, you should always add a stop(); command at the end of the animation to prevent exactly this issue (which is an issue for every version of Flash, not AS3). Without a stop(); command, the Flash file will loop once it reaches the last frame of the timeline.

But perhaps you have a different issue than this...

1 reply

somascope
somascopeCorrect answer
Inspiring
March 1, 2008
Are these Flash animations ones that you created? If you have access to the FLA files of your external SWF files, you should always add a stop(); command at the end of the animation to prevent exactly this issue (which is an issue for every version of Flash, not AS3). Without a stop(); command, the Flash file will loop once it reaches the last frame of the timeline.

But perhaps you have a different issue than this...
rohicksAuthor
Participant
March 1, 2008
srlindberg, ok yes you are right, but i guess i left out another detail.

When you use stop(); it does stop it, but i want it to stop and yet remain on the screen and not disappear.
Is there a way to do that?

Right now it will play through the animation, stop, then disappear.
But i want to keep it up after 1 time it has played and then stay on stage.