Flash question
- Started
- Last post
- 6 Responses
- OBBTKN
Hi people...
I need to stop a timeline, the root timeline, from a mc what got the play and pause buttons on it.
The question is, the timeline have got a delay as script, that i think is doing conflict with the _root.stop(); function.
If anybody can help me, here is a sample fla 8 file to download: http://www.obabatiken.com/nt/pla…
ta
- flashbender0
this might be a silly suggestion but have you tried
on (press) {
_root.stop();
clearInterval(delay);
}
- OBBTKN0
Thnx flashbender... but did´nt work.
Another way??
- fyoucher10
If the delay is created using setInterval (as stated above), clearing it should work. Just make sure you have the correct scope for the delay var. If it's in root, you can use clearInterval(_root.delay) albeit using _root is a bad idea.
I'll check out your FLA real quick.
- fyoucher10
Yeah, my suggestion above should work...altho...you 'do' have code that triggers next frame, so it 'might' be possible to clear the interval and go to the next frame at the same time since your interval is so low. What I would do is add a boolean value to your proceed function that checks whether to advance to the next frame or not. ie. var isProceed:Boolean = true; and then in ur func check if that var is true or false before going to next frame. The button would switch the boolean value on clicks (ie. isProceed = !isProceed;). Also, I wouldn't duplicate that function and variable declaration in every frame. Just create a function to call the interval and call that function every time you want to instead of recreating the same code for all 10 frames. If you want to have a different interval value at diff occasions, just pass a parameter into that function. Hope that helps.
- OBBTKN0
thanks very much fyoucher... works fine now!
you´ve saved my day
- fyoucher10
np :)