2 Replies Latest reply on Apr 3, 2007 11:21 AM by SymTsb

    setInterval scope

    SymTsb Level 2

      Working on a simple image fade in, fade out routine here. Standard setInterval use to run through an array of images. The code works beautifully until I inserted it into my SWindow class.

      Its pretty simple actually. When the media container is created, the first image is loaded and then setInterval is called to cycle through the images....pretty standard stuff. But here's where it goes funny. The trace statements inside nextImage return undefined. They are member functions of the class so I'd have thought that scope was good but apparently it is not.

      I've tried sending setInterval a reference to my SWindow class among other things. The result is no execution of the nextImage call at all but no errors are reported. I've provided the code for the three functions in question. I've tested the code outside of a class....it's from my repository....and I know it works. I am only having problems after the code is inside a class. Any help, pointers, or simple slaps in the head for missing something easy are all appreciated at this point.