You can't change the backgroundcolor of the selected link but you can
change the color and font properties to show that its selected. Below is
the sample code, where I'm changing the font color of the selected link
to red and also making it bold. Hope this will help.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";
width="600" height="600">
<mx:Script>
<![CDATA[
        
          function doLinkBar(event){
                  for(var i=0; i<event.target.numChildren; i++){
                   var curItem = event.target.getChildAt(i);
                   
                   if (i==event.index)
                   {
                        curItem.setStyle("color", 0xFF0000);
                        curItem.setStyle("fontWeight", 'bold');
                   }else{
                        curItem.setStyle("color", 0x000000);
                        curItem.setStyle("fontWeight", 'normal');
                   }
                   
                 }
        }
]]>
</mx:Script>

 <mx:LinkBar id="lb1"
dataProvider="{['Flex','Flash','Dreamweaver','Breeze']}"
click="doLinkBar(event)"/>
 
</mx:Application>


To show the selected link as red and bold when the page first loads, you
can write an initialize event handler and change the link appearance of
the default selected link in that function.

-Ashish



> -----Original Message-----
> From: [email protected] 
> [mailto:[EMAIL PROTECTED] On Behalf Of delaquae
> Sent: Monday, September 12, 2005 7:39 AM
> To: [email protected]
> Subject: [flexcoders] Re: Is there a LinkBar style similar to 
> activeTab for tabNavigator
> 
> Thanks Saleh,
> 
> I am already quite familiar with the CSS Style explorer but 
> unfortunately it does not expose all the styles that are available 
> for each component and what I'm trying to do is not a documented 
> style that I have been able to find anyway.  I suspect I will have 
> to do it with some ActionScript and that was what I am looking for 
> help with.  But thanks for the response.
> 
> Martin
> 
> --- In [email protected], vnice Cute <[EMAIL PROTECTED]> 
> wrote:
> > Hello,
> > Please try this URL 
> http://weblogs.macromedia.com/mc/archives/FlexStyleExplorer.html
> > that may help you to build your CSS file very easy.
> >  
> > Thanks,
> > Saleh
> > 
> > delaquae <[EMAIL PROTECTED]> wrote:
> > Is there any way for a LinkBar to approximate the activeTab style 
> > behaviour?  Either with a style or via ActionScript?  I need to 
> set 
> > the background and text color for a link once it has been selected 
> > in order to visually indicate that it was selected/active. With a 
> > TabNavigator I was able to do this with:
> > 
> > TabNavigator {
> >    horizontal-gap: 6;
> >    tab-height: 21;
> >    theme-color: #ffffff;
> >    background-color: #3399cc;
> >    }
> > 
> > Tab {
> >    fill-colors: #cccccc, #f6eeee;
> >    selected-fill-colors: #3399cc, #3399cc;
> >    color: #334444;
> >    }
> > 
> > ActiveTab {
> >       color: white;
> >       font-weight: bold;
> >       text-roll-over-color: white;
> >       }
> > 
> > 
> > 
> > 
> > 
> > --
> > Flexcoders Mailing List
> > FAQ: 
> http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives: http://www.mail-archive.com/flexcoders%
> 40yahoogroups.com 
> > 
> > 
> > 
> > ---------------------------------
> > YAHOO! GROUPS LINKS 
> > 
> > 
> >     Visit your group "flexcoders" on the web.
> >   
> >     To unsubscribe from this group, send an email to:
> >  [EMAIL PROTECTED]
> >   
> >     Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
> Service. 
> > 
> > 
> > ---------------------------------
> > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around 
> > http://mail.yahoo.com
> 
> 
> 
> 
> 
> ------------------------ Yahoo! Groups Sponsor 
> --------------------~--> 
> Most low income households are not online. Help bridge the 
> digital divide today!
> http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/nhFolB/TM
> --------------------------------------------------------------
> ------~-> 
> 
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.com 
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to