WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 setInterval in an object, chris, July 10, 2003
     Re:setInterval in an object, k, July 11, 2003
         Re:setInterval in an object, Erik Arvidsson, July 11, 2003
             Re:setInterval in an object, Chris, July 13, 2003
             Re:setInterval in an object , tim scarfe, July 12, 2003
                 Re:setInterval in an object , Erik Arvidsson, July 13, 2003
             Re:setInterval in an object, k, July 11, 2003
                 Re:setInterval in an object, Erik Arvidsson, July 11, 2003

Subject: setInterval in an object From: chris Date: July 10, 2003
I'm not sure if this is a bug in Mozilla, or me missing something obvious about objects. Here's the situation i'm facing:

I've created an object using a constructor function (i want the ability to allow more than one of these in a page...) and assigned a method to it. Now, the method can be called inside the object function itself, like

function chris() {

...

this.method1 = someFunction;

...

//calling it here:

this.method1();

}

//how things tie in...

chris.prototype = someFunction;

function someFunction(){

...

}

So how come i can call this.method1() within the function chris(), but if i put

setInterval("this.method1()",1000);

within chris() (instead of just this.method1()), i get errors...?

Now, i imagine this shouldn't be an issue, but it is. does anyone know why?

As always, i presume its me being an idiot, but i'd like to know :)

Chris



Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX