caddystorage
Technical User
Hi, I'm a newbie to Flash. anyways, i need to make a movieclip stop inside a specific ztarget zone. At the moment the movieclip stops even if you are just partially touching the target area. How do I get it to stop (or bump into) only the target zone so that it stop at the same location everytime?
This is my code so far :
ball2.onPress = function() {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;
};
onEnterFrame = function () {
if (counter == 2) {
reply_txt.text = "Congrats, you're finished!";
}
};
ball2.onRelease = function() {
this.stopDrag();
if (eval(this._droptarget) == box) {
duplicateMovieClip("ball2","shelf",10)
onEnterFrame = function(){
shelf._x += xmove;
}
; reply_txt.text = "THIS FITS";
this.enabled = false;
} else {
reply_txt.text = "DOES NOT FIT";
this._x = xstart;
this._y = ystart;
}
wheel.swapDepths(this.getNextHighestDepth());
};
ball3.onPress = function() {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;
};
ball3.onRelease = function() {
this.stopDrag();
if (eval(this._droptarget) == box2) {
reply_txt.text = "THIS FITS";
this.enabled = false;
} else {
reply_txt.text = "DOES NOT FIT";
this._x = xstart;
this._y = ystart;
}
wheel.swapDepths(this.getNextHighestDepth());
};
ball.onPress = function() {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;
};
ball.onRelease = function() {
this.stopDrag();
if (eval(this._droptarget) == box3) {
reply_txt.text = "THIS FITS";
this.enabled = false;
} else {
reply_txt.text = "DOES NOT FIT";
this._x = xstart;
this._y = ystart;
}
wheel.swapDepths(this.getNextHighestDepth());
};
Thanks in advance.
This is my code so far :
ball2.onPress = function() {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;
};
onEnterFrame = function () {
if (counter == 2) {
reply_txt.text = "Congrats, you're finished!";
}
};
ball2.onRelease = function() {
this.stopDrag();
if (eval(this._droptarget) == box) {
duplicateMovieClip("ball2","shelf",10)
onEnterFrame = function(){
shelf._x += xmove;
}
; reply_txt.text = "THIS FITS";
this.enabled = false;
} else {
reply_txt.text = "DOES NOT FIT";
this._x = xstart;
this._y = ystart;
}
wheel.swapDepths(this.getNextHighestDepth());
};
ball3.onPress = function() {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;
};
ball3.onRelease = function() {
this.stopDrag();
if (eval(this._droptarget) == box2) {
reply_txt.text = "THIS FITS";
this.enabled = false;
} else {
reply_txt.text = "DOES NOT FIT";
this._x = xstart;
this._y = ystart;
}
wheel.swapDepths(this.getNextHighestDepth());
};
ball.onPress = function() {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;
};
ball.onRelease = function() {
this.stopDrag();
if (eval(this._droptarget) == box3) {
reply_txt.text = "THIS FITS";
this.enabled = false;
} else {
reply_txt.text = "DOES NOT FIT";
this._x = xstart;
this._y = ystart;
}
wheel.swapDepths(this.getNextHighestDepth());
};
Thanks in advance.