【发布时间】:2012-05-19 03:34:57
【问题描述】:
Flex Mobile 应用程序中是否有一种方法可以监听 <s:View> 的事件,该 <s:ViewNavigator> 位于 <s:ViewNavigator> 内?假设我有以下应用程序结构:
主要应用:
<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
creationComplete="databaseConnection(event)">
<s:ViewNavigator id="tasks" width="100%" height="100%"
label="Tasks" firstView="views.TasksView"
title="Tasks" icon="@Embed('assets/icons/tasks.png')">
</s:ViewNavigator>
</s:TabbedViewNavigatorApplication>
view.TasksView:
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<s:Button label="New View" click="{navigator.pushView(views.AddTask)}"/>
</s:View>
view.AddTask:
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
creationComplete="{dispatchEvent(new Event("happened"))}">
<fx:Metadata>
[Event(name="happened", type="flash.events.Event")]
</fx:Metadata>
</s:View>
假设我想在主应用程序中侦听 happened 事件。我怎样才能听到这样的事件?
感谢您的宝贵时间。
【问题讨论】:
标签: android ios flash apache-flex flex4