如何使用的DropTarget在AS3?

编程入门 行业动态 更新时间:2024-10-19 19:24:21
本文介绍了如何使用的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?

本文发布于:2023-11-23 16:01:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622052.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   DropTarget

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!