title: tweenlite as2 oncomplete
body: <p>I seem to be having trouble with TweenLite in AS2.</p>
  
  <p>I've created a class which I call on the main timeline. Within the class I've loaded images and once they are loaded I want to fade between them. I am calling (inside my class) the following code when the images have finished loading:</p>
  
  <pre><code>TweenLite.to(_root["loadedimg1"], 1, {_alpha: 100, 
              onComplete:doImageLoop, onCompleteParams:[1], onCompleteScope:this});
  </code></pre>
  
  <p>I then have the following function to do the fade loop:</p>
  
  <pre><code>public function doImageLoop(imageId:Number):Void 
  {
      trace(imageId);
      var newImageId:Number;
      TweenLite.to(_root["loadedimg" + imageId], 1, {delay:2, _alpha: 0});
      if ((imageId + 1) &gt; queueCount) {
          newImageId = 1;
      } else {
          newImageId = imageId + 1;
      }
      TweenLite.to(_root["loadedimg"+newImageId], 1, {delay:3, _alpha: 100, 
                onComplete:doImageLoop, onCompleteParams:[newImageId], 
                onCompleteScope:this, overwrite:0});
      }
  </code></pre>
  
  <p>This function never gets hit but this first image does fade up.</p>