mardi 7 mars 2017

Starting with functions on AS3

i'm new in AS3, and i would like to know how to make this to work. What i want is when i mouseover one object, the other appears from 0 alpha to 1. I searched google but i cannot find anything that helps me with this issue.

The code is this one:

var frequency = 3;
stage.enableMouseOver(frequency);
this.movieClip_1.addEventListener("mouseover", fl_MouseOverHandler);

function fl_MouseOverHandler()
{

// Execute movieclip 2 function

}


var movieClip_2_FadeInCbk = fl_FadeSymbolIn.bind(this);
this.addEventListener('tick', movieClip_2_FadeInCbk);
this.movieClip_2.alpha = 0;

   function fl_FadeSymbolIn()
   {
   this.movieClip_2.alpha += 0.01;
   if(this.movieClip_2.alpha >= 1)
   {
        this.removeEventListener('tick', movieClip_2_FadeInCbk);
   }
}

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire