【发布时间】:2011-12-06 18:54:59
【问题描述】:
画布的空白区域不会触发事件。
我的问题是我的应用程序中有一个画布,它显示了一个由不同图形组成的图表,但画布空白处不会触发我需要的事件,如翻转。
你能告诉我如何让我的画布触发事件,即使在空白处?
我已经设置了背景颜色、mouseEnabled、颜色、边框、alpha、opaqueBackground等,没有任何效果。
我使用的是 Flex 4,我只需要使用 mx:Canvas。
这里是事件监听器注册:
canDiagram.addEventListener(MouseEvent.ROLL_OVER, function(event:MouseEvent):void{if(actualCursor != null){CursorManager.setCursor(actualCursor,2,-10,-10);}},true);
canDiagram.addEventListener(MouseEvent.ROLL_OUT, function(event:MouseEvent):void{CursorManager.removeAllCursors();},true);
【问题讨论】:
标签: actionscript-3 apache-flex events flex4 event-handling