0
New Here
,
/t5/animate-discussions/setinterval-passing-parameters/td-p/302908
Nov 08, 2006
Nov 08, 2006
Copy link to clipboard
Copied
I'm wondering if someone has an idea why this won't work....
//------------------------------
function example(){
trace(this);
}
example();
setInterval(example, 100);
//-------------------------------------
When I call function without setInterval it traces "_level0" , but when function is called with setInterval, function traces "undefined". ...
Does anyone have idea how to fix this?
//------------------------------
function example(){
trace(this);
}
example();
setInterval(example, 100);
//-------------------------------------
When I call function without setInterval it traces "_level0" , but when function is called with setInterval, function traces "undefined". ...
Does anyone have idea how to fix this?
TOPICS
ActionScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Advisor
,
Nov 08, 2006
Nov 08, 2006
replace your setInterval call with its alternative syntax:
setInterval(this, "example", 1000);
this identifies the scope of the function being called. see livedocs
setInterval(this, "example", 1000);
this identifies the scope of the function being called. see livedocs
Advisor
,
/t5/animate-discussions/setinterval-passing-parameters/m-p/302909#M308524
Nov 08, 2006
Nov 08, 2006
Copy link to clipboard
Copied
replace your setInterval call with its alternative syntax:
setInterval(this, "example", 1000);
this identifies the scope of the function being called. see livedocs
setInterval(this, "example", 1000);
this identifies the scope of the function being called. see livedocs
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
zstasa
AUTHOR
New Here
,
LATEST
/t5/animate-discussions/setinterval-passing-parameters/m-p/302910#M308525
Nov 08, 2006
Nov 08, 2006
Copy link to clipboard
Copied
Thank You... you help me a lot...
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

