Citation :
//**********************************************************************//
//************************* CREATION DE BOUTON *************************//
//**********************************************************************//
MovieClip.prototype.creerBouton = function(texte, nom, profondeur, x, y) {
this.createEmptyMovieClip(nom, profondeur);
var btn_mc = this[nom]; btn_mc.createTextField("btn_txt", 1, 0, 0, 1, 1); //z, x, y, h, w
btn_mc.btn_txt.autoSize = true;
btn_mc.btn_txt.selectable = false;
btn_mc.btn_txt.text = texte; var btn_tf = new TextFormat();
btn_tf.font = "_sans";
btn_mc.btn_txt.setTextFormat(btn_tf);
btn_mc.txtLargeur = btn_mc.btn_txt._width + 4;
btn_mc.txtHauteur = btn_mc.btn_txt._height; btn_mc.etatHaut = function() {
this.btn_txt._x = 2;
this.btn_txt._y = 1;
this.clear();
this.moveTo(this.txtLargeur, 0);
this.beginFill(0xCCCCCC);
this.lineStyle(1, 0x000000);
this.lineTo(this.txtLargeur, this.txtHauteur);
this.lineTo(0, this.txtHauteur);
this.lineStyle(1, 0xFFFFFF);
this.lineTo(0, 0);
this.lineTo(this.txtLargeur, 0);
this.endFill();
} btn_mc.etatBas = function() {
this.btn_txt._x = 3;
this.btn_txt._y = 2;
this.clear();
this.moveTo(this.txtLargeur, 0);
this.beginFill(0xCCCCCC);
this.lineStyle(1, 0xFFFFFF);
this.lineTo(this.txtLargeur, this.txtHauteur);
this.lineTo(0, this.txtHauteur);
this.lineStyle(1, 0x000000);
this.lineTo(0, 0);
this.lineTo(this.txtLargeur, 0);
this.endFill();
} btn_mc.onPress = btn_mc.etatBas;
btn_mc.onRelease = function() {
this.etatHaut();
this.onButton();
}
btn_mc.onReleaseOutside = btn_mc.etatHaut;
btn_mc.etatHaut();
btn_mc._x = x;
btn_mc._y = y;
}
this.creerBouton("Next", "Bt_Next_mc", 7, 200, 12);
Bt_Next_mc.onButton = function() {
//action sur un onRelease du bouton Bt_Next_mc
}
//**********************************************************************//
//******************** FIN DE LA CREATION DE BOUTON ********************//
//**********************************************************************//
|