var counter:Number = 0;
var no:Sound = new Sound();
no.attachSound("again");
var yes1:Sound = new Sound();
yes1.attachSound("amaizing");
var yes2:Sound = new Sound();
yes2.attachSound("good job");
var yes3:Sound = new Sound();
yes3.attachSound("great");
onEnterFrame = function():Void{
if(counter == 4){
reply_txt.text = "Well Done!";
}
};
square_mc.onPress = function():Void {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;
};
square_mc.onRelease = function():Void {
this.stopDrag();
if (eval(this._droptarget) == squareTarget_mc) {
reply_txt.text="You got it!";
this.enabled = false;
counter++;
yes1.start(0,1);
}
else {
reply_txt.text="No, keep trying!";
this.enabled = true;
this._x = xstart;
this._y = ystart;
no.start(0,1);
}
};
flower_mc.onPress = function():Void {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;
};
flower_mc.onRelease = function():Void {
this.stopDrag();
if (eval(this._droptarget) == flowerTarget_mc) {
reply_txt.text="You got it!";
this.enabled = false;
counter++;
yes2.start(0,1);
}
else {
reply_txt.text="No, keep trying!";
this.enabled = true;
this._x = xstart;
this._y = ystart;
no.start(0,1);
}
};
triangle_mc.onPress = function():Void {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;
};
triangle_mc.onRelease = function():Void {
this.stopDrag();
if (eval(this._droptarget) == triangleTarget_mc) {
reply_txt.text="You got it!";
this.enabled = false;
counter++;
yes2.start(0,1);
}
else {
reply_txt.text="No, keep trying!";
this.enabled = true;
this._x = xstart;
this._y = ystart;
no.start(0,1);
}
};
pentagon_mc.onPress = function():Void {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;
};
pentagon_mc.onRelease = function():Void {
this.stopDrag();
if (eval(this._droptarget) == pentagonTarget_mc) {
reply_txt.text="You got it!";
this.enabled = false;
counter++;
yes3.start(0,1);
}
else {
reply_txt.text="No, keep trying!";
this.enabled = true;
this._x = xstart;
this._y = ystart;
no.start(0,1);
}
};
square_mc2.onPress = function():Void {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;
};
square_mc2.onRelease = function():Void {
this.stopDrag();
if (eval(this._droptarget) == squareTarget_mc2) {
reply_txt.text="You got it!";
this.enabled = false;
counter++;
yes1.start(0,1);
}
else {
reply_txt.text="No, keep trying!";
this.enabled = true;
this._x = xstart;
this._y = ystart;
no.start(0,1);
}
};
