ragazzi qualcuno conosce o mi può consigliare su come creare una funzione che richiamata ed associata ad un mc lo faccia scomparire progressivamente con effetto alpha?
ragazzi qualcuno conosce o mi può consigliare su come creare una funzione che richiamata ed associata ad un mc lo faccia scomparire progressivamente con effetto alpha?
Despite of my rage i'm still just a rat in a cage
Se ho capito la domanda vuoi questo:
Metti questa funzione sul primo Keyframe dela timeline (livello functions):
MovieClip.prototype.alpha = function(aarrivo, a, b, t) {
///////////
if ((aarrivo != "goto")&&(a != '' && a != "" && a != 0)&&(b != '' && b != "" && b != 0)) {this.k = (1/b)/a;}
else {if ((aarrivo != "goto")&&(a != '' && a != "" && a != 0)&&(b == '' || b == "" || b == 0)) {this.k = 1/a;}
else {this.k = 0.1;}}
if (aarrivo == "goto") {this._alpha = a;this.aarrivo = b;}
else {this.aarrivo = aarrivo;}
///////////
this.da = 0;
this._visible=true;
this.t = t;
this.t1 = getTimer()/100;
this.onEnterFrame = function() {
this.t2 = getTimer()/100;
if ((this.t2 >= this.t1 + this.t) || (this.t == '' || this.t == "" || this.t == 0)) {
this.da = (this.aarrivo-this._alpha)*this.k;
if (Math.abs(this.da)>0.1) {
this._alpha += this.da;
} else {
this._alpha = this.aarrivo;
if (this._alpha == 0) {this._visible=false;}
delete this.onEnterFrame;
}
}
};
};
Poi, sul movieclip, dai questo script (l'esempio più banale ma te la puoi giocare come vuoi):
onClipEvent (load) {
this.alpha("goto",0,100,1);
}
dove 0 è il valore di partenza, 100 il valore di arrivo ed 1 è l'attesa espressa in decimi di secondo..
Ok??
ottimo, quello che cercavo!![]()
Despite of my rage i'm still just a rat in a cage
Di nulla, nella mia immensa ignoranza è un piacere poter aiutare qualcuno![]()