0 Replies Latest reply on Jun 5, 2006 10:57 PM by SteveDriveRa

    setInterval within a class of a component

    SteveDriveRa Level 1
      I am trying to run a function, or class at a certain interval specified by the user. They would enter the interval time as a paramater, and then would load on that.
      I can place the code within the stage Frame 1 - layer 1 and works fine..

      var intervalID:Number;
      var intTime:Number = (sensor1.setTime* 1000) * 60;
      lblTime = sensorTime + " Minutes";
      intervalID = setInterval(runObjects(), intTime);

      function runObjects(){
      sensor1.openService();
      }


      but when i use:

      intervalID = setInterval(sensor1.openService(), 10000); from the stage, or using the input variable, it doesn't seem to register...
      and placing it within the class it self doesn't work either.

      I'm a bit lost.