Solved

Spark Tab bar rollover index.. flex4 problem

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

733 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