Solved

Spark Tab bar rollover index.. flex4 problem

Posted on 2011-03-12
4
676 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

914 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

23 Experts available now in Live!

Get 1:1 Help Now