1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
var touche:SharedObject = SharedObject.getLocal("joueur", "/");
var etat:Array = new Array("haut", "bas", "gauche", "droit", "poing1", "pied1", "special1", "valider");
var etat_total:Number = etat.length;
//chargement des variables stokés ds un Shared Object
for (var i:Number = 1; i<=2; i++) {
for (var j:Number = 0; j<etat_total; j++) {
this["P"+i][etat[j]] = this["P"+i][etat[j]]=String.fromCharCode(touche.data["P"+i+[etat[j]]]);
this["P"+i+[etat[j]]].maxChars = 1;
}
}
//qd le joueur appuie sur la touche valider les variables sont sauvegardé dans le Shared Object
this.btn_valider.onRelease = function() {
for (var i:Number = 1; i<=2; i++) {
for (var j:Number = 0; j<etat_total; j++) {
touche.data["P"+i+[etat[j]]] = this._parent["P"+i][etat[j]].charCodeAt();
touche.flush();
//
_parent.view.unloadMovie();
}
}
trace("enregistrement");
} |
Partager