Groups | Blog | Home
all groups > flash (macromedia) > january 2006 >

flash (macromedia) : setInterval not working with Buttons


german01
1/27/2006 10:07:39 PM
Hi
I'm trying to create a memory game. I'm using individual buttons containing
two movie clips. One movie clip acts as a cover and the other movie shows the
graphic.

When a user clicks on the cover, the button displays the graphic. This is
where I have trouble because the graphic is displayed for a few seconds, but
then goes forth and back to the cover and doesn't stop.

HOW TO STOP THE MOVIE FROM GOING FORTH AND BACK -graphic to cover-?
In other words, once the buttons is clicked it starts looping from graphic to
cover and doesn't stop.


This is the script on graphic frame.

var id = setInterval();
var id = setInterval(function(){}, 5000);
var id = setInterval(function() {
}, 5000);


var id = setInterval(function() {
play();
}, 5000);


stop();
var id = setInterval(function() {
play()
clearInterval(id);
}, 5000);



This is the code on the button

on(release){
_root.mc1.gotoAndStop("graphic");
}


German


urami_
1/28/2006 12:00:00 AM
stop();
ID = setInterval(myFunction, 5000);
function myFunction() {
gotoAndStop("label_after_interval");
clearInterval(ID);
}

[quoted text, click to view]

Problem could be if you try to apply multiple interval of same ID name to different clips.
Perhaps in your case would be much easier to simply add frames to these clips ?


--
Regards

Urami


--



Happy New Year guys - all the best there is in the 2006 :)




<urami>
http://www.Flashfugitive.com
</urami>

<web junk free>
http://www.firefox.com
AddThis Social Bookmark Button