菜单 - RightNavigation
<fx:Metadata>
[Event(name="interval", type="flash.events.Event")]
<fx:Metadata>
[Bindable]
public var sInterval:String;
[Bindable]
public var sIntervalId:String;
protected function intervalSelected(event:MouseEvent):void
{
sInterval = intervalMenu.selectedItem.intervals_miles;
sIntervalId = intervalMenu.selectedItem.interval_id;
dispatchEvent(new Event("interval"));
}
MENU - RightNavigation = 这是菜单中的按钮
<s:VGroup includeIn="iMenu" width="100%" height="100%" horizontalAlign="center" paddingTop="10">
<s:List id="intervalMenu" styleName="leftNavContent" creationComplete="miles_handler(event)"
itemRenderer="renderers.MilesItemRenderer" click="intervalSelected(event)" >
<s:AsyncListView list="{intervalsResult.lastResult}"/>
</s:List>
</s:VGroup>
模块 - mcIntervals
initialize="init()"
import containers.RightNavigation;
import mx.binding.utils.ChangeWatcher;
import flash.events.*;
[Bindable]
public var interval:RightNavigation;
public function init():void
{
//addEventListener("interval", intervalServices);
ChangeWatcher.watch(interval, "sIntervalId", intervalServices);
}
protected function intervalServices(e:Event):void
{
Alert.show("test");
}
应用程序设置
MainApp 有两个容器 RightNavigation 和 MainContent
MainContent 有一个名为 mcIntervals 的模块
所以我试图将值从 RightNavigation 发送到 mcIntervals
这是一个桌面应用程序,如果这有什么不同的话
这不起作用我可以看到它在调试模式下发送值,但 ChangeWatcher 或 evenListener 没有检测到任何东西
谢谢,罗伯特