Hey everyone,
Would anybody happen to know of a way to make this work:
Again I know there are other ways to do this (just calling a periodic "alert('hi' )", for instance), but this is for an animation class where I want to keep information about the layer packaged away in an object. Could I pass the object as an argument in the setInterval call (using the this keyword, somehow, I think)?
Thanks in advance,
Lars
Would anybody happen to know of a way to make this work:
Code:
function myObject()
{
this.someText="Hi!";
this.period=setInterval("alertsometext();",2000);
}
function alertsometext()
{
alert(this.someText);
}
n=new myObject();
Thanks in advance,
Lars
Comment