Flex Parsley - 如何处理 flash.events.MouseEvent
我正在使用欧芹框架。 在我的应用程序中,Parsley 的消息传递系统对于自定义事件运行良好。
但是,在某些区域,我在某些组件上有 MouseDown、MouseUp 事件的事件侦听器。如何处理flash内置事件?
谢谢
I am using Parsley framework.
In my application, messaging system of Parsley is working fine for custom events.
But, in some areas, I have event listeners for MouseDown, MouseUp events on some components. How to deal with flash inbuilt events ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我没有使用过 Parsely,但我认为它的工作原理与 Robotlegs 类似。在 Robotlegs 中,我将此类事件包装在一个单独的事件中,以保护其目标和 currentTarget 不被更改(如果重新分派它,就会发生这种情况),然后将该事件发送到事件总线中。请参阅http://riarockstars .com/2011/05/17/problem-solving-in-flex-and-robotlegs-drag-and-drop/ 了解更多详细信息。
I haven't used Parsely, but I would think it works similarly to Robotlegs. In Robotlegs, I have wrapped such events in a separate event that protects its target and currentTarget from being changed (as would happen if you redispatched it), then send that event into the event bus. See http://riarockstars.com/2011/05/17/problem-solving-in-flex-and-robotlegs-drag-and-drop/ for more details.
一个误解是认为欧芹应该处理所有消息传递。 Parsley 的目标是帮助您解耦应用程序。解耦在一定程度上是好的,Flex 4 (Spark) 已经让您将逻辑与视图布局分开。
因此,您不必使用 Parsley 的消息传递来处理所有事情。就像将信号用于所有事情并不是最好的主意一样。
如果您有一个视图需要与模型、命令、服务、其他视图等进行通信,那么您可以使用该视图的事件处理程序,调度一个 Parsley 事件。
查看
http://artinflex.blogspot.com/2010 /09/quick-dive-into-parsley-basic-messaging.html
对于基础知识。
另外,如果您希望 Parsley 管理 Flex Events,请检查
http://artinflex.blogspot.com/2010 /09/quick-dive-into-parsley-messaging-with.html
A missconception is to thing that Parsley should handle ALL messaging. Parsley's goal is to help you decouple your application. Decoupling is good to an extent, and Flex 4 (Spark) already let's you separate the logic from the View layout.
So you do not have to use Parsley's messaging for everything. Just like using Signals for everything isn't the best idea.
If you have a view that needs to communicate with models, commands, services, other views, etc... then you can have the view's event handler, dispatch a Parsley event.
Check out
http://artinflex.blogspot.com/2010/09/quick-dive-into-parsley-basic-messaging.html
for the basics.
Also in case you wish to have Parsley manage Flex Events then also check
http://artinflex.blogspot.com/2010/09/quick-dive-into-parsley-messaging-with.html
尝试在大多数可能的情况下使用 Flex 事件处理..
除非有使用框架的要求。
为该特定鼠标事件添加事件处理程序...在对象上..
并进行相应处理。
Try to use flex event handling for most possible cases ..
unless there is a requirement to use the framework .
add a eventhandler for that specific mouse event... on the object ..
and handle it accordingly.