Forum de discussion
Forum « Flash et Shockwave » (archives)
Re: calcul
Envoyé: 5 avril 2005, 13h03 par blues
MovieClip.prototype.Proto_Text = function(Txt, Lg, Hg, Font, Size, TxtColor, Alignement, Bold) {
this.createTextField("TxtField", 0, 0, 0, Lg, Hg);
this.TxtField.multiline = true;
this.TxtField.border = true;
this.TxtField.selectable = false;
this.TxtField.wordWrap = true;
this.TxtField.Format = new TextFormat();
this.TxtField.Format.color = TxtColor;
this.TxtField.Format.font = Font;
this.TxtField.Format.size = Size;
this.TxtField.Format.align = Alignement;
this.TxtField.Format.bold = Bold;
this.TxtField.text = Txt;
this.TxtField.setTextFormat(this.TxtField.Format);
};
//
MovieClip.prototype.Proto_InputII = function(Txt, Lg, Hg, Font, Size, TxtColor, Alignement, Bold) {
this.createTextField("TxtField", 0, 0, 0, Lg, Hg);
this.TxtField.selectable = true;
this.TxtField.type = "input";
this.TxtField.multiline = true;
this.TxtField.border = true;
this.TxtField.borderColor = TxtColor;
this.TxtField.background = true;
this.TxtField.backgroundColor = 0xEEEEEE;
this.TxtField.wordWrap = true;
if ((Txt == "") or (Txt == undefined)) {
Txt = "";
}
this.TxtField.text = Txt;
this.TxtField.Format = new TextFormat();
this.TxtField.Format.color = TxtColor;
//this.TxtField.Format.font = Font;
this.TxtField.Format.size = Size;
this.TxtField.Format.align = Alignement;
this.TxtField.Format.bold = Bold;
this.TxtField.setTextFormat(this.TxtField.Format);
//
};
//
_root.createEmptyMovieClip("Utilisateur", 0 )
_root.Utilisateur.Proto_InputII ("", 100, 20, "Arial", 12, 0x000000, "Center", "Bold")
//
ValeurA = 13
_root.createEmptyMovieClip("ValI", 1 )
_root.ValI.Proto_Text(ValeurA, 100, 20, "Arial", 12, 0x000000, "Center", "Bold")
_root.ValI._y = 30
//
ValeurB = 7
_root.createEmptyMovieClip("ValII", 2 )
_root.ValII.Proto_Text (ValeurB, 100, 20, "Arial", 12, 0x000000, "Center", "Bold")
_root.ValII._y = 60
//
Resultat = ValeurA+ValeurB
_root.createEmptyMovieClip("Result", 3 )
_root.Result._y = 90
//
_root.Utilisateur.TxtField.onChanged = function () {
Resultat = this.text*(ValeurA+ValeurB)
_root.Result.Proto_Text (Resultat, 100, 20, "Arial", 12, 0x000000, "Center", "Bold")
trace(Resultat)
};
_
Réponses
|