本文介绍了如何使用的DropTarget在AS3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将其转换AS2 code到AS3。
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...
推荐答案首先,你将需要开始使用事件侦听器。
First off, you're going to need to start using event listeners.
现在的主要问题。 DropTarget的似乎停止更新工作最近。我不完全知道为什么。
Now to the main issue. dropTarget appeared to stop working in an update recently. I'm not entirely sure why.
因此,你将需要改变做法。相反的DropTarget,请使用以下任一...
Thus, you're going to need to change approach. Instead of droptarget, use one of the following...
- 的DisplayObject hitTestPoint()
- 的DisplayObject hitTestObject()(注意,this一个值匹配 对象的边框,而不是对象的实际 形状)
- 位图则hitTest()。
- DisplayObject hitTestPoint()
- DisplayObject hitTestObject() (beware, this one matches to the bounding box of the object, NOT to the object's actual shape)
- Bitmap hitTest().
我建议hitTestPoint()出了三个,但最终的决定是由你。
I recommend hitTestPoint() out of the three, but the final decision is up to you.
更多推荐
如何使用的DropTarget在AS3?
发布评论