将这个TextField的mouseEnabled属性设置为false即可。

我们看到:

Specifies whether this object receives mouse messages. The default value is true, which means that by default any InteractiveObject instance that is on the display list receives mouse events. If mouseEnabled is set to false, the instance does not receive any mouse events. Any children of this instance on the display list are not affected. To change the mouseEnabled behavior for all children of an object on the display list, use flash.display.DisplayObjectContainer.mouseChildren.

这说明,如果将mouseEnabled设置为false,则它不会接收到任何Mouse事件。同时,也忽略了useHandCursor这样的属性设置。(这一点似乎在帮助中并没有明显说明)

我的一段代码片段:

cursor.useHandCursor = true;
cursor.buttonMode = true;
cursor.cursor_txt.mouseEnabled = false;

这个cursor是一个需要进行鼠标交互的“光标”,其上有“cursor_txt”这样一个TextField实例,动态地显示一些关于当前标签的信息。当mouseEnabled设置为false之后,cursor的手型就显示出来了。

Still looking for something?

: http://as3blog.com/as3/textfield-mouseenabled-false-usehandcursor-solution/

Post a comment now » Sorry, the comments are closed.

No comments yet.

Sorry, the comment form is closed at this time.