Solved

Spark Tab bar rollover index.. flex4 problem

Posted on 2011-03-12
4
673 Views
Last Modified: 2013-11-19
Hi Experts,

       I am using a the spark tabbar and gave a view stack as dataprovider.....in the view stack there are  n elements ...and each element has a panel....

 

my code would be  some thing like this....

 

 

<s:tabbar dataprovider = {viewstck-id}  height="100%" width="100%"/>

<viewstack id="viewstck-id">

    <navigatorContent >

         <s:panel title="title - 1"/>

     </navigatorContent >

     <navigatorContent >

         <s:panel title="title - 2"/>

     </navigatorContent >\

     <navigatorContent >

         <s:panel title="title - 3"/>

     </navigatorContent >

</viewstk>

 

My requirement is something like this......initially the panel of the select tab should show the its own title..suppose if we are on tab-1 the title should be title-1 ...but when we roll over our mouse on tab-2 the title of the panel in tab-1 should be changed to tittle-2  and if the mouse is on tab3 the  title of the panel in tab-3 should be changed to tittle-3  and on roll out it should be changed to selected tab's panel's title , i.e. title-1....and in similar way it should work for all the tabs.....

 

So is there any way to get the  get the rollOverIndex of the tab Or some one please provide me a solution.

0
Comment
Question by:arigs
4 Comments
 

Author Comment

by:arigs
ID: 35119280
Note: small change
if the mouse is on tab3 the  title of the panel in tab-3 should be changed to tittle-1
0
 
LVL 20

Accepted Solution

by:
ChristoferDutz earned 500 total points
ID: 35126653
Well at first I would suggest to give the navigator-content elements ids and to place the label there too.
Have a look at the sample code here:
http://help.adobe.com/de_DE/AS3LCR/Flex_4.0/spark/components/TabBar.html


If you want your described effect, I currently see two main options:

1.  I would suggest to create a custom TabBarSkin and within this you define your own TabBarButtonSkin. Inside this you should be able to navigate

ViewStack(ButtonBar(ButtonBarButton(hostComponent).parent).dataProvider).rawChildren.getChildAt(0).label = "hurz!";

I would debug this however, as this might not be 100% correct, It's just in order to give you the idea.

2. I would create a custom TabBarButtonSkin that fires custom events on rollover/rollout. It is important that you set the bubbling property of these events to true, so they can be caught up the component tree. You then register some listeners on the TabBar and handle the updating of tab-labels accordingly.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This video teaches users how to migrate an existing Wordpress website to a new domain.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now