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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

this should be simple! only plays once

Status
Not open for further replies.

BPetro

Programmer
Oct 1, 2002
59
US
OK, this should be working but i guess I'm missing somthing. I made a swf, (imported sound, image, first frame is a stop so this doesn't automatically happen on page load, second frame has the actual actions, last frame does a stop). I place this in a web page and for testing put a button that does a simple "flash goto frame 2". All fine, page loads and the swf does not do anything during the load, I press the button and the swf plays. BUT here's the oddity - I press the button a second time and nothing happens. What am I missing here?
 
in the last frame where your movie stops...
is the button still running on the same frame on the same layer as in frame one?

is it possible your button has entered a new keyframe and therefor does not have the actions applied to it when the movie stops in the final frame?
 
Interesting thought, but if I understand your question right, the answer is no, the button itself is not in flash. Its just a button in the html page with the simple code from dreamweaver: onclick="MM_controlShockwave('0','','GotoFrame','1')"

Again, it works first time, then never works again. BUT - based on your question - it has me thinking... There are two layers, one is imported sound, the other a simple jpg to display while the sound plays. Could it be we do the stop in the wrong layer or something like that? Can the swf be stuck in a wrong layer so that GotoFrame: 1 doesn't restart it? You might have something there that I could try, but I don't think we have a "play" or any such action in either layer, so it doesn't seem like that would be it. Any ideas you might have regarding "gotchas" on that sort of issue? Are there any "understood" steps for "resetting" a swf after playing it that we simply don't know? Or "always stop in a sound layer" or such rule? We're pretty new to flash so it is probably something pretty simple like that. PPS: It is not yet posted to any public web access, only internal linux server.
 
in the last frame of your movie put the code:

"gotoAndStop(1);"

and remove your current "stop();" tag...

this way you can-
A): test to ensure your movie is reaching the end of the timeline and there is no red herring "stop" actions applied somewhere that is stopping it prematurely

B) the movie will be set back to the 1st frame on the timeline which is where it started in the first place, so the movie should work more than once
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top