|
-
gotoAndStop not working
Hi
I have what will probably amount to a very small problem: I can't seem to get flash to stop repeating itself with the gotoAndStop function.
I have 4 frames: on frame 1, I have a button generating a random number from 2 to 4 (only 3 frames, I know). once hit, the button generates the random number and moves to said frame. No problems until the animation on the frame just endlessly loops.
I've got stop(); on each of the 3 frames in question, I'm using the gotoAndStop command in frame 1 when calling the random frame into play. I'm a total n00b with Flash and AS, and I'm sorry if this is a really daft question, but how do I get it to stop once the movieclip has played?
Thanks in advance
-
So you have a movieclip on each frame? and when you get to one of those frames the animation inside that movieclip is repeatedly begin played? Just add a stop() at the end of the animation inside that movieclip then.
-
thanks for the reply Geneve, I'm trying it as I type... and you are amazing!!! I didn't think to go into the movieclip and THEN add the stop at the last frame of the actual clip. Duh!
Once again, thank you so much for the help
-
Nice
-
Pumpkin Carving 2008
Alternately you could have checked from -outside- the MovieClip to see if it was finished playing:
Code:
// AS2 syntax
if (MC1._currentframe == MC1._totalframes) {
MC1.stop();
}
...but at least you fixed your problem.
The 'Boose':
ASUS Sabertooth P67 TUF
Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
8GB G.Skill Ripjaws 1600 DDR3
ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
New addition: OCZ Vertex 240GB SATA III SSD
WEI Score: 7.6
-
Senior Member
that code is logically correct, but for me sometimes it wouldn't fire, as if, a frame has been skipped(enterFrame event)....and hence I personally prefer the option of manually putting the stop() on the last frame.
If you like me, add me to your friends list  .
PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!
My Arcade My Blog
Add me on twitter: 
-
Pumpkin Carving 2008
I commented on the fact that it's AS2 syntax. I've pretty much forgotten how basic AS2 works. :/
The 'Boose':
ASUS Sabertooth P67 TUF
Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
8GB G.Skill Ripjaws 1600 DDR3
ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
New addition: OCZ Vertex 240GB SATA III SSD
WEI Score: 7.6
-
thanks for the replies guys, I've taken the "easy" way out and just added stop() to the end of each movieclip (I only have 6) and it works a treat.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|