问题
I need to convert this AS2 code to AS3.
on (release)
{
stopDrag();
this.MOR1.zzz.gotoAndStop(1);
if (this._droptarget == "/lcd5") {
this.MOR1.zzz.shekl.gotoAndStop(1);
_root.nor.gotoAndStop(3);
} else {
this.MOR1.zzz.shekl.gotoAndStop(4);
_root.nor.gotoAndStop(2);
}
if (this._droptarget == "/lcd1") {
setProperty(this, _x, -731.7);
setProperty(this, _y, 626.4);
}
}
Please help me. Thank you...
回答1:
First off, you're going to need to start using event listeners.
Now to the main issue. dropTarget appeared to stop working in an update recently. I'm not entirely sure why.
Thus, you're going to need to change approach. Instead of droptarget, use one of the following...
- DisplayObject hitTestPoint()
- DisplayObject hitTestObject() (beware, this one matches to the bounding box of the object, NOT to the object's actual shape)
- Bitmap hitTest().
I recommend hitTestPoint() out of the three, but the final decision is up to you.
来源:https://stackoverflow.com/questions/21071984/how-to-use-droptarget-in-as3