Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Spark Tab bar rollover index.. flex4 problem

Posted on 2011-03-12
4
Medium Priority
?
696 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
2 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

876 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