Solved

Spark Tab bar rollover index.. flex4 problem

Posted on 2011-03-12
4
691 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

 Database Backup and Recovery Best Practices

Join Percona’s, Architect, Manjot Singh as he presents Database Backup and Recovery Best Practices (with a Focus on MySQL) on Thursday, July 27, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7). In the case of a failure, do you know how long it will take to restore your database?

Question has a verified solution.

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

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
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 …
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to count occurrences of each item in an array.

626 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