1 Attachment(s)
AS2 help -- Disable dragging once movieclip reaches designated area?
Hi everyone!
I'm using Flash 8, AS2. To simplify things, I made an .fla using basic shapes, and have it attached here.
I have a black circle, that has a purple circle in it. I want to drag and drop the green circle onto the black circle, and have the purple circle immediately be sent to the yellow box.
My question is:
Once one of the colored circles is in the black circle, how can I disable the dragging of that circle? Make it immovable until the other colored circle takes its place?
Here's the actionscript I have already, which addresses everything EXCEPT disabling the mobility:
PHP Code:
on(press){
startDrag(_root.gbutton);
dragging = true;
}
on (release,releaseOutside) {
stopDrag();
dragging = false;
if(this._x > 30 && this._x < 70 && this._y > 30 && this._y < 70)
{
setProperty(this,_x,58.0)
setProperty(this,_y,54)
dragging=false
}
if(_parent.pbutton._x == 58.0 && _parent.pbutton._y == 54)
{
setProperty(_parent.pbutton,_x,420.0)
setProperty(_parent.pbutton,_y,40.0)
}
}
And I have the same for if I want the purple to take the place of the green.
Please forgive any clunky script, and thank you so much for your time!