开发者

How to run clickHandlers on buttons moved from main view component to header bar

I've used JRab's example here http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/App-specific-system-menu/td-p/693... to add a header menu to my app. What I'm having trouble with is executing my functions from the header mennu. For example, my firstView is appHome.mxml. It instantiates a Canvas object that has an erase(). There is a button in appHope.mxml that executes the erase() on the Canvas instance. I'm trying move the Erase button out of my appHome.mxml and into my headerMenu.mxml but don't know how to execute the erase() on the Canvas instance. The first thing I thought to try was click="{appHome.myCanvas.erase()开发者_运维技巧}" but obviously that didn't work.

I asked a similar question yesterday here: Flex executing a function on another view and I accepted the answer before I tried it. The problem is that the headermenu.mxml is not a child of appHome.mxml. They are both children of the main app.mxml. Secondly, the object that has the erase() is in a separate .as class I instantiate in appHome.mxml.

I hope I described my question well enough. Thanks n advance to anyone that can help.


Based on your description, I don't understand how my comment on the previous answer doesn't answer it.

The event from headermenu dispatches up to app; which can call the method on it's child (appHome) like this:

appHome.erase()
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜