Copy link to clipboard
Copied
How do I delete the onEnterframe. This is my code:
function myCountDown(){
//do something
}
RecLoad.onData = function(src) {
if (condition == true) {
_root.onEnterFrame = myCountDown; // works fine
}
}
Clear_btn.onRelease = function () {
delete myCountDown.onEnterFrame; //does not respond
}
use:
function myCountDown(){
//do something
}
RecLoad.onData = function(src) {
if (condition == true) {
_root.onEnterFrame = myCountDown; // works fine
}
}
Clear_btn.onRelease = function () {
delete _root.onEnterFrame;
}
Copy link to clipboard
Copied
use:
function myCountDown(){
//do something
}
RecLoad.onData = function(src) {
if (condition == true) {
_root.onEnterFrame = myCountDown; // works fine
}
}
Clear_btn.onRelease = function () {
delete _root.onEnterFrame;
}
Copy link to clipboard
Copied
Thanks Kglad.
Will that affect if there are more onEnterFrame functions running?
Copy link to clipboard
Copied
you can only have, at most, one onEnterFrame per movieclip in as2. so, if you used:
_root.onEnterFrame=f1;
_root.onEnterFrame=f2;
only the last executed one (calling f2 repeatedly) will exist. the first (calling f1 repeatedly) is overwritten and replaced.
Copy link to clipboard
Copied
Thanks again.
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now