2 Replies Latest reply on Jan 23, 2008 3:04 AM by niki tsanov

    Fading out then load new image then fade in?

    headful
      This is the setup..
      I call the onPress event on a image that fades out whatever image is in the loader componet then, I want load a new image and fade back in but, i can only get one or the other to work. I'm trying to fade in and out using onEnterFrame event but, it's giving me weird results... here is the code

      var flag:boolean = true;

      mainLoader.onEnterFrame = function(){

      flag = this._alpha -= 10 : this._alpha += 10;

      if(this._alpha <= 0){
      flag = false;
      mainLoader.contentPath = "this.jpg";
      } else if(!flag && this.alpha >= 100){
      delete this.onEnterFrame;
      }

      }