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!

cant clearInterval in class

Status
Not open for further replies.

kmobayeni

Technical User
Jul 11, 2006
9
US
Hi:

I have just started working with classes and am having trouble using setInterval/clearInterval in the class. I am sure my scoping is incorrect but I am not sure how to fix it. My problem (simplified) is below:

Code:

class myClass extends MovieClip {
var loopImage:Number
function myFunc1(){
loopImage = setInterval(cycleImages, 4500);
}
function myFunc2(){
clearInterval(loopImage);
}
function cycleImages(){
//irrelevent whats in here
}
}


Bascially, how do I set up my interval so that when "myFunc2" is called, loopImage is not undefined and it is able to clear the interval.

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top