Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run movie once only 1

Status
Not open for further replies.

arkadia93

Programmer
Oct 19, 2006
110
0
0
GB
Is it possible to make your swf run through once and then stop (i.e. the movie only loops once)?
 
The simplest way is to put the actionscript 'stop()' command on the last frame of your movieclip.

Add a layer in your movieclip and call it Actions.

Open the actions panel under the 'windows' menu and in the last frame of your movieclip insert a keyframe on the Actions layer then type 'stop()' for this frame in the actions panel.

You could put 'stop()' in the actions panel on any layer, but good practice is to create a separate layer for programming, which is the 'Actions' layer. Use it only for Actionscript. Don't put any graphics on this layer. In fact, good practice is to lock this layer as soon as you create it, so you can't accidently put any graphics on it. Even though it is locked you can still insert Actionscript for this layer using the Actions panel.[thumbsup]
 
But doesn't this just stop the movie before it goes back to the beginning again in another loop?
 
I want my movie to only loop once i.e. to run just once and then stop.
 
Using Stop() doesn't prevent the movie looping over and over again when you publish it and use it in a web page. Is there not a flag that you can set in the code when publishing the movie which is something like LoopOnce=true or Loop=1 or something?
 
Using Stop() doesn't prevent the movie looping over and over again when you publish it and use it in a web page. "

yes it does.
 
Excellent, I've been trying to solve this for ages! Cheers Oldnewbie!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top