codice:
var casuale:Array = new Array();
//Casuale Array che Contiene le prima tre lettere Dei MOvieClip da spostare ("Ntt"+"Btn"=NttBtn)
casuale=["Arg","Sab","Qua","Fel","Oss","All"];
var numR:Number=0;
//Num R Restituisce un Valore random tra le posiazioni libere dell'array
//come vedremo ogni volta viene tolto l'elemento di posiazione NumR dall'array
//Vaso superiore sinistro
numR=Math.floor(Math.random()*(casuale.length));
//trace(numR+" + "+casuale[numR]);
_root.attachMovie(casuale[numR], casuale[numR], this.getNextHigestDept(),{_x:280.1, _y:444.7});
casuale.quaice(numR,1);//con questo metodo togliamo l'elemento di pos NumR
//(1 vuol dire che leviamo un solo elemento dalla pos NumR)
//Vaso superiore centrale
numR=Math.floor(Math.random()*(casuale.length));
//trace(numR+" + "+casuale[numR]);
_root.attachMovie(casuale[numR], casuale[numR], this.getNextHigestDept(),{_x:449.5, _y:444.7});
casuale.quaice(numR,1);//con questo metodo togliamo l'elemento di pos NumR
//(1 vuol dire che leviamo un solo elemento dalla pos NumR)
//Vaso superiore destro
numR=Math.floor(Math.random()*(casuale.length));
//trace(numR+" + "+casuale[numR]);
_root.attachMovie(casuale[numR], casuale[numR], this.getNextHigestDept(),{_x:617.3, _y:444.7});
casuale.quaice(numR,1);//con questo metodo togliamo l'elemento di pos NumR
//(1 vuol dire che leviamo un solo elemento dalla pos NumR)
//Vaso inferiore sinistro
numR=Math.floor(Math.random()*(casuale.length));
//trace(numR+" + "+casuale[numR]);
_root.attachMovie(casuale[numR], casuale[numR], this.getNextHigestDept(),{_x:192.2, _y:509.4});
casuale.quaice(numR,1);//con questo metodo togliamo l'elemento di pos NumR
//(1 vuol dire che leviamo un solo elemento dalla pos NumR)
//Vaso inferiore centrale
numR=Math.floor(Math.random()*(casuale.length));
//trace(numR+" + "+casuale[numR]);
_root.attachMovie(casuale[numR], casuale[numR], this.getNextHigestDept(),{_x:364.8, _y:509.4});
casuale.quaice(numR,1);//con questo metodo togliamo l'elemento di pos NumR
//(1 vuol dire che leviamo un solo elemento dalla pos NumR)
//Vaso inferiore destro
numR=Math.floor(Math.random()*(casuale.length));
//trace(numR+" + "+casuale[numR]);
_root.attachMovie(casuale[numR], casuale[numR], this.getNextHigestDept(),{_x:531.0, _y:509.4});
casuale.quaice(numR,1);//con questo metodo togliamo l'elemento di pos NumR
//(1 vuol dire che leviamo un solo elemento dalla pos NumR)
//Creiamo Un booleano perverificare quali bottoni sono correttamente posizionati
//ogni volta che ne posiziono 1 viene verificato che tutti sono posizionati
//(controollo se sono tutti TRUE) in tal caso vado in play!
ArgTf=false;
SabTf=false;
QuaTf=false;
FelTf=false;
OssTf=false;
AllTf=false;
//Vaso Argilla
Arg.onPress = function():Void {
xx=Arg._x;
yy=Arg._y;
if(ArgTf!=true){//trace("Preso!");
this.startDrag(false);
//reply_txt.text="bellavita"
}
};
Arg.onRelease = function():Void {
//trace("Rilasciato!");
this.stopDrag();
if (eval(this._droptarget) == Imp) {
//reply_txt.text="Bravo!";
//trace("Bravissimo!")
this._visible=false;
my_sound.start();
ArgTf=true;
_root.attachMovie(ArgCheck1, ArgCheck1, this.getNextHigestDept(),{_x:1055.3, _y:306.9});
if(ArgTf&&SabTf&&QuaTf&&FelTf&&OssTf&&AllTf){gotoAndPlay(1);}
}
else {
wrongSound.start();
Arg._x=xx;
Arg._y=yy;
//reply_txt.text="Mettimi al posto giusto!";
}
};
//Vaso Sabbia
Sab.onPress = function():Void {
xx=Sab._x;
yy=Sab._y;
if(SabTf!=true){//trace("Preso!");
this.startDrag(false);
//reply_txt.text="bellavita"
}
};
Sab.onRelease = function():Void {
//trace("Rilasciato!");
this.stopDrag();
if (eval(this._droptarget) == Imp) {
//reply_txt.text="Bravo!";
//trace("Bravissimo!")
this._visible=false;
my_sound.start();
SabTf=true;
_root.attachMovie(SabCheck2, SabCheck2, this.getNextHigestDept(),{_x:1063.8, _y:332.4});
if(ArgTf&&SabTf&&QuaTf&&FelTf&&OssTf&&AllTf){gotoAndPlay(1);}
}
else {
wrongSound.start();
Sab._x=xx;
Sab._y=yy;
//reply_txt.text="Mettimi al posto giusto!";
}
};
//Vaso Quarzo
Qua.onPress = function():Void {
xx=Qua._x;
yy=Qua._y;
if(QuaTf!=true){//trace("Preso!");
this.startDrag(false);
//reply_txt.text="bellavita"
}
};
Qua.onRelease = function():Void {
//trace("Rilasciato!");
this.stopDrag();
if (eval(this._droptarget) == Imp) {
//reply_txt.text="Bravo!";
//trace("Bravissimo!")
this._visible=false;
my_sound.start();
QuaTf=true;
_root.attachMovie(QuaCheck3, QuaCheck3, this.getNextHigestDept(),{_x:1057.3, _y:358.9});
if(ArgTf&&SabTf&&QuaTf&&FelTf&&OssTf&&AllTf){gotoAndPlay(1);}
}
else {
wrongSound.start();
Qua._x=xx;
Qua._y=yy;
//reply_txt.text="Mettimi al posto giusto!";
}
};
//Vaso Feldspato
Fel.onPress = function():Void {
xx=Fel._x;
yy=Fel._y;
if(FelTf!=true){//trace("Preso!");
this.startDrag(false);
//reply_txt.text="bellavita"
}
};
Fel.onRelease = function():Void {
//trace("Rilasciato!");
this.stopDrag();
if (eval(this._droptarget) == Imp) {
//reply_txt.text="Bravo!";
//trace("Bravissimo!")
this._visible=false;
my_sound.start();
FelTf=true;
_root.attachMovie(FelCheck4, FelCheck4, this.getNextHigestDept(),{_x:1125.8, _y:304.4});
if(ArgTf&&SabTf&&QuaTf&&FelTf&&OssTf&&AllTf){gotoAndPlay(1);}
}
else {
wrongSound.start();
Fel._x=xx;
Fel._y=yy;
//reply_txt.text="Mettimi al posto giusto!";
}
};
//Vaso Ossido di Ferro
Oss.onPress = function():Void {
xx=Oss._x;
yy=Oss._y;
if(OssTf!=true){//trace("Preso!");
this.startDrag(false);
//reply_txt.text="bellavita"
}
};
Oss.onRelease = function():Void {
//trace("Rilasciato!");
this.stopDrag();
if (eval(this._droptarget) == Imp) {
//reply_txt.text="Bravo!";
//trace("Bravissimo!")
this._visible=false;
my_sound.start();
OssTf=true;
_root.attachMovie(OssCheck5, OssCheck5, this.getNextHigestDept(),{_x:1125.8, _y:328.4});
if(ArgTf&&SabTf&&QuaTf&&FelTf&&OssTf&&AllTf){gotoAndPlay(1);}
}
else {
wrongSound.start();
Oss._x=xx;
Oss._y=yy;
//reply_txt.text="Mettimi al posto giusto!";
}
};
//Vaso Allumina
All.onPress = function():Void {
xx=All._x;
yy=All._y;
if(AllTf!=true){//trace("Preso!");
this.startDrag(false);
//reply_txt.text="bellavita"
}
};
All.onRelease = function():Void {
//trace("Rilasciato!");
this.stopDrag();
if (eval(this._droptarget) == Imp) {
//reply_txt.text="Bravo!";
//trace("Bravissimo!")
this._visible=false;
my_sound.start();
AllTf=true;
_root.attachMovie(WatCheck1, WatCheck1, this.getNextHigestDept(),{_x:1122.8, _y:355.9});
_root.attachMovie(WatCheck2, WatCheck2, this.getNextHigestDept(),{_x:1136.9, _y:350.9});
if(ArgTf&&SabTf&&QuaTf&&FelTf&&OssTf&&AllTf){gotoAndPlay(1);}
}
else {
wrongSound.start();
All._x=xx;
All._y=yy;
//reply_txt.text="Mettimi al posto giusto!";
}
};
Più che altro volevo sapere come posso sostituire i comandi deprecati nella nuova versione di AS.