开发者

Context menu for loaded SWF

开发者 https://www.devze.com 2022-12-07 23:55 出处:网络
I have a Flex app with a viewport that loads a series of other swfs.I would like to place a context menu over top of the SWFs when the开发者_JAVA百科 user right-clicks.To that end, I have set up a fai

I have a Flex app with a viewport that loads a series of other swfs. I would like to place a context menu over top of the SWFs when the开发者_JAVA百科 user right-clicks. To that end, I have set up a fairly standard context menu where each item has a ContextMenuEvent.MENU_ITEM_SELECT event handler. One problem: The eventHandler never gets called.

If I place the context-menu code anywhere else in the app, i.e. not on top of a loaded SWF, everything works fine. However, when I place the exact same code on the SWF viewport, the context menu items appear, but the eventHandlers are never called. Any ideas?


I'm not sure I understand your problem, but this is my insight. The SWF is embedded and can only be expected to change the visual appearance of your Flex app, but you cannot expect the embedded SWF to do the work of dispatching events as well. You will need to "bubble out" the events into the SWF's parent(s) and let the parent deal with the event. http://www.adobe.com/devnet/flex/articles/itemrenderers_pt1.html

Let me know, thanks!


i think is because the event doesn't bubble up to your app where you have the listeners.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号