Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In simple words:</p> <ol> <li><p>Add IndexChangeEvent listener to your TabbedViewNavigator instance [ <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/events/IndexChangeEvent.html" rel="nofollow noreferrer">http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/events/IndexChangeEvent.html</a> ]</p></li> <li><p>When index is changed or is changing check for tabbedViewNavigatorInstance.navigators[newIndex] firstView equal Home.</p></li> <li><p>If is Home hide Home tab else show Home tab, for this task check this post [ <a href="https://stackoverflow.com/questions/9129909/hiding-a-tab-in-a-spark-tabbar/11518142#11518142">Hiding a tab in a Spark TabBar</a> ]</p></li> </ol> <p>The implementation itself can be done in multiple ways depending on your current flow. </p> <p>Here an quick example that works:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="160" applicationComplete="onAppComplete(event)"&gt; &lt;fx:Declarations&gt; &lt;!-- Place non-visual elements (e.g., services, value objects) here --&gt; &lt;/fx:Declarations&gt; &lt;fx:Script&gt; &lt;![CDATA[ import spark.components.DataGroup; import spark.events.IndexChangeEvent; import views.HomeView; private function onAppComplete(e : Event) : void { this.tabbedNavigator.addEventListener(IndexChangeEvent.CHANGE, onIndexChange); showHomeTab(false); } private function onIndexChange(e : IndexChangeEvent) : void { var vn : ViewNavigator = this.navigators[e.newIndex] as ViewNavigator; if(vn.firstView === HomeView){ showHomeTab(false); } else { showHomeTab(true); } } private function showHomeTab(state : Boolean) : void { var dg : DataGroup = this.tabbedNavigator.tabBar.dataGroup; ///if HomeView is at index 0 dg.getElementAt(0).visible = state; dg.getElementAt(0).includeInLayout = state; } ]]&gt; &lt;/fx:Script&gt; &lt;s:ViewNavigator label="Home" width="100%" height="100%" firstView="views.HomeView"/&gt; &lt;s:ViewNavigator label="Other" width="100%" height="100%" firstView="views.OtherView"/&gt; &lt;/s:TabbedViewNavigatorApplication&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload