MarikLover666
07-16-2007, 09:00 PM
Ok hi, I'm ML666! I joined just now with the hope that someone here can clearly help me with an issue that I'm having, since everywhere else I've tried didn't help me..
You see, I'm trying to make a dress-up game, and I know the good ol' drag and drop AS, but I want to know the AS for the drag and snap kind... By searching around, I had found and edited a bit an AS the someone posted somewhere, and it worked except for one thing that bothers me... You can only drag the item over a part of the model in order for it to stick into place; if you, say, tried to drop a necklace over where a shirt was on the model, it wouldn't snap to the model and it'd go back to its starting location.. I have a feeling that there's a simple way to fix this.. I just don't know how to... But what do I know... It might be complicated to fix.. I dunno... It just seems like you should be able to say if it's over the model (no matter what else is there) it snaps to its correct place..
Here is what I've got so far:
necklaces.onPress = function () {
necklaces.startDrag();
}
necklaces.onRelease = function () {
necklaces.stopDrag();
if (eval(this._droptarget) == model) {
this._x = 31.6;
this._y = 327.8;
}else {
this._x = 31.6;
this._y = 327.8;
}
if (eval(this._droptarget) != model) {
this._x = 170.7;
this._y = 327.0;}
}
------
I'm also wondering.. Is this part necessary?:
}else {
this._x = 31.6;
this._y = 327.8;
}
You see, I'm trying to make a dress-up game, and I know the good ol' drag and drop AS, but I want to know the AS for the drag and snap kind... By searching around, I had found and edited a bit an AS the someone posted somewhere, and it worked except for one thing that bothers me... You can only drag the item over a part of the model in order for it to stick into place; if you, say, tried to drop a necklace over where a shirt was on the model, it wouldn't snap to the model and it'd go back to its starting location.. I have a feeling that there's a simple way to fix this.. I just don't know how to... But what do I know... It might be complicated to fix.. I dunno... It just seems like you should be able to say if it's over the model (no matter what else is there) it snaps to its correct place..
Here is what I've got so far:
necklaces.onPress = function () {
necklaces.startDrag();
}
necklaces.onRelease = function () {
necklaces.stopDrag();
if (eval(this._droptarget) == model) {
this._x = 31.6;
this._y = 327.8;
}else {
this._x = 31.6;
this._y = 327.8;
}
if (eval(this._droptarget) != model) {
this._x = 170.7;
this._y = 327.0;}
}
------
I'm also wondering.. Is this part necessary?:
}else {
this._x = 31.6;
this._y = 327.8;
}