apache-flex - 在 Flex 选项卡式 View 导航器之间切换

标签 apache-flex actionscript-3 blackberry-playbook

我正在开发具有三个选项卡(ViewNavigator 元素)的 Flex TabbedViewNavigatorApplication。我想根据用户操作(通过 ActionScript 代码)从一个 ViewNavigator 切换到另一个。

我知道在 View 之间切换使用 pushViewpopView,但我正在使用 ViewNavigators,我的搜索没有显示任何有用的信息。

我正在尝试在事件发生时从 Tab2 切换到 Tab1。在这种情况下,Tab2 包含一个列表,当用户进行选择时,我想跳回 Tab1。

<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                                  xmlns:s="library://ns.adobe.com/flex/spark"
                                  creationComplete="onAppReady(event)">
    <s:ViewNavigator label="Tab1" width="100%" height="100%" firstView="views.TabOneView"/>
    <s:ViewNavigator label="Tab2" width="100%" height="100%" firstView="views.TabTwoView"/>
    <s:ViewNavigator label="Tab3" width="100%" height="100%" firstView="views.TabThreeView"/>
</s:TabbedViewNavigatorApplication>

感谢您的帮助!

最佳答案

我使用以下 ActionScript 行根据用户操作从一个 ViewNavigator 切换到另一个:

TabbedViewNavigator(navigator.parentNavigator).selectedIndex = 1;

它就像一个魅力,看起来比冒泡事件更简单。

关于apache-flex - 在 Flex 选项卡式 View 导航器之间切换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6118344/

相关文章:

android - 在 Android 上的 AIR 中浏览文件夹?

actionscript-3 - 如何在 ActionScript 3.0 中写入文本文件?

android - 如何调试playbook模拟器?

android - 在 Android 应用程序的 BlackBerry Playbook 上创建文件时出现问题?

apache-flex - 在 flex 应用程序中使用 mxml 比 actionscript 有什么优势?

java - 如何将war文件转换为项目?

android - 谷歌播放 : "The server could not process your apk. Try again."

actionscript-3 - 乘以 AARRGGBB 颜色的 Alpha channel

apache-flex - 在flex的右键单击上下文菜单中隐藏默认选项

c++ - 如何让 Qt 在 blackberry playbook 上工作