我創造了Flex3與窗口式應用程序的Adobe Flash Builder的4.7FLEX4 - 使用按鈕欄從一個文件的.mxml導航到另一個
我有兩個的.mxml文件(Main.mxml和Home.mxml)
在Main.mxml我有按鈕欄,當上了首頁按鈕欄,用戶點擊,我希望用戶被重定向到Home.mxml
我一直在谷歌上搜索這一段時間,現在並沒有明確的答案在這。
我已經看過ViewStack和TabNavigator和國家,我不知道如果這是我正在尋找。
這裏是我的Main.mxml文件
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
applicationComplete="init()"
showStatusBar="false">
<fx:Declarations></fx:Declarations>
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
s|ButtonBar s|ButtonBarButton:upAndSelected,
s|ButtonBar s|ButtonBarButton:overAndSelected,
s|ButtonBar s|ButtonBarButton:downAndSelected,
s|ButtonBar s|ButtonBarButton:disabledAndSelected {
chromeColor: #666666;
color: #FFFFFF;
fontSize: 32;
}
s|ButtonBar {
chromeColor: #000000;
color: #FFFFFF;
fontSize: 32;
bottom: 0;
typographicCase: uppercase;
}
</fx:Style>
<s:ButtonBar width="100%" height="13%">
<mx:ArrayCollection>
<fx:String>Home</fx:String>
</mx:ArrayCollection>
</s:ButtonBar>
</s:WindowedApplication>
,這裏是我的Home.mxml文件
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Label text="Here"/>
</s:WindowedApplication>
請幫助
使它具有兩個選項卡的TabNavigator,因此您不必處理按鈕。 – Organis