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.
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.