Flash and stop looping Action Script
Copy link to clipboard
Copied
I am trying to build a flash webpage in Adobe and I have a small amount of the background done but it loops every time.
Searching the web it says to put in an action script of stop(); it will not let me do this on the current layer so I created a new layer “layer 7” and added the required action script. When I uploaded it to my webpage it plays but the second it is finished it loops.
I tested it with the player built into the flash pro cs4 and it stops and does not loop. I also checked the index.html code and it has Loop set to false.
Is there something else that I should do?
Thanks,
Brad
Copy link to clipboard
Copied
Having the stop(); in the last frame of the animated timeline is all you need. Do you have any other actionscript in the movie?
Copy link to clipboard
Copied
Nope I have just created a few shapes and used Alpha and Tween to have them move in.
Copy link to clipboard
Copied
Is there any chance you could take a screenshot showing your timeline with stop() frame and the AS code window and attach it to a posting response? Don't upload the image, use the editor feature to plant it in the posting itself.
I'd offer to look at the fla file for you, but I would need to have the file saved as a CS3 file, and you'd need somewhere you can upload it to, like your own server (the upload feature of these forums is suffering badly).
Copy link to clipboard
Copied
The server IP is http://66.181.218.118/
If anyone else has CS4 here is the FLA file. http://66.181.218.118/SJCEU_V2.fla
I converted the cs4 to cs3 it changed the tween to individual frames but hope this helps. http://66.181.218.118/SJCEU_V3.fla
and here is the photo you asked for.
Copy link to clipboard
Copied
I will still try to look at the file, but from what I can see in the image, you should put a keyframe one frame before where you have that function in Layer 5, get rid of that function, and just put stop(); in the new keyframe. If it's your intention to have nothing visible at the end, then just get rid of the function that surrounds the stop(); and leave the stop(); by itself in its current frame.
Update: Yep, I looked at the file and what I said above appears to apply. You don't want the stop inside a function unless you have something there that calls the function. stop(); by itself is all you really need.
Copy link to clipboard
Copied
Darn thing is still looping.
I have noticed I cant type Stop(): in the script I have to paste it in. Is there something I need to do to allow me to type it in?
Copy link to clipboard
Copied
For what I see now, it should be fine as long as you aren't using an uppercase s for stop(); I'll save the file I checked and make it available for you here.
As far as typing in the actionscript panel, if you have script assist turned on, it may not allow you to. I haven't used it since about a week after I first tried to eons ago.
Here's the file I modified as suggested.
Copy link to clipboard
Copied
Ok I Downloaded the FLA file you edited and exported it as a SWF and uploaded it. Still loops. Thanks for all your help BTW.
Brad
Copy link to clipboard
Copied
I'll try embedding/loading my file to a server in the morning (it's hit the hay time now) and we'll see if it loops there also. I know it doesn't loop in preview mode.
Copy link to clipboard
Copied
Sorry about the delay Brad, I must have gotten a good night's sleep... I forgot to follow up on this yesterday. I published the fla and loaded the files to my server and the looping does not happen. I didn't change any of the Publish Settings you have in the file.
http://www.nedwebs.com/Flash/SJCEU_V3.html
http://www.nedwebs.com/Flash/SJCEU_V3.swf
What you might try doing is creating a new file and copying the frames from the current file into it. It's possible the CS4 file is corrupted somehow. You could also try saving the CS3 version as a CS4 file.
Copy link to clipboard
Copied
Thanks, I downloaded the version you had working on your webpage and put that one on server and is still looping so I am reviewing my index.html to make sure everthing is correct there.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r" />
<title>Carriage Oaks</title>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
</head>
<body bgcolor="#C0C0C0">
<!--url's used in the movie-->
<!--text used in the movie-->
<!--
Sound
Sound
Sound
Sound
Sound
-->
<!-- saved from url=(0013)about:internet -->
<div align="center">
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '900',
'height', '1090',
'src', 'main',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'false',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'main',
'bgcolor', '#C0C0C0',
'name', 'main',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'main',
'salign', ''
); //end AC code
}
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="900" height="1090" id="main" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="main.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#14355e" /> <embed src="main.swf" quality="high" bgcolor="#04090d" width="900" height="1090" name="main" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>
</div>
</body>
</html>
Copy link to clipboard
Copied
If you can't find anything outstanding in your index html, try placing my html file on your server and see if it still loops... it may be some weird server issue. While not personally, I have dealt with a couple of people who ended up changing their hosts because the server was screwy.
Copy link to clipboard
Copied
Your explanation worked for me the first time! Thanks!
Copy link to clipboard
Copied
At least someone is having some success!
Copy link to clipboard
Copied
I have the stop in the last spot on a new layer past the rest of the layers will that work?

