codice:
import mx.transitions.*;
import mx.transitions.easing.*;
function createButton(Nome, Larg, Alt, X, Y, C_Fill, C_Line, LargBand, C_Fil_Band){
this.createEmptyMovieClip(Nome,1)
this[Nome]._x = X; this[Nome]._y = Y
with (Nome) {
lineStyle(1, C_Line, 100);beginFill(C_Fill, 100);moveTo(0, 0);
lineTo(Larg, 0);
lineTo(Larg, Alt);
lineTo(0, Alt);
lineTo(0, 0);
endFill();
}
this[Nome].createEmptyMovieClip("Vbar",1)
this[Nome].Vbar._x=0
this[Nome].Vbar._y=0
this[Nome].Vbar.beginFill(C_Fill_Band, 100)
this[Nome].Vbar.moveTo(0, 0);
this[Nome].Vbar.lineTo(LargBand, 0);
this[Nome].Vbar.lineTo(LargBand, Alt);
this[Nome].Vbar.lineTo(0, Alt);
this[Nome].Vbar.lineTo(0, 0);
this[Nome].Vbar.endFill();
this[Nome].Vbar._yscale=0
this[Nome].onRollOver=function(){
var twScale = new mx.transitions.Tween(this.Vbar, "_yscale", None.easeNone, 0, 100, 1, true);
}
this[Nome].onRollOut=function(){
var twScale = new mx.transitions.Tween(this.Vbar, "_yscale", None.easeNone, this.Vbar._yscale, 0, 1, true);
}
}
createButton("myBTN", 50, 20, 10, 10, "0xC2C2C2", "0x333333", 10, "0x990000")