Below is the more efficient way of achieving the same thing with less lines of code. Previously I had some typo in my code so it wasn't working ;)
 
function headerTextColor()
 {
     // accordion1 is an id of the accordion

    for(var i=0; i<accordion1.numChildren; i++){
           var header = accordion1.getHeaderAt(i);
           i==accordion1.selectedIndex ? header.setStyle("color", 0xFF0000) : header.setStyle("color", 0x000000);
       }
 
 }
 
 
-Ashish

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ashish Goyal
Sent: Thursday, June 23, 2005 1:44 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Accordian Header Colors

I have attached the code below which is pretty much self explainatory. In this function I'm setting the color of all the headers to black and then setting the color of the selcted header to red. Call this function on change event of the accordion.
 
function headerTextColor()
 {
     // accordion1 is an id of the accordion

   for(var i=0; i<accordion1.numChildren; i++){
    var header = accordion1.getHeaderAt(i);
    header.setStyle("color", 0x000000)
   }
 
  var headerIndex = accordion1.getHeaderAt(accordion1.selectedIndex);
  headerIndex.setStyle("color", 0xFF0000)
 
 }
 
I could also have the fuction coded in another way which is more efficient (inside the for loop, check if "i" is the selectedIndex and change the color to red otherwise black) but its not working for few of the style properties. I'll log the bug in the Flex bugbase.
 
Thanks
-Ashish
 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Andy Goodfellow
Sent: Thursday, June 23, 2005 10:34 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Accordian Header Colors

Does anyone know how to change the font color of the selected accordion header? I can get things like the background and fill color to change fine using either actionscript skinning or a swc theme file, I just can't seem to find any documentation on how to change the font color of a selected header. Thanks in advance.

-Andy

On 1/9/05, dave buhler <[EMAIL PROTECTED]> wrote:
Thanks Manish.

I'll give it a shot tomorrow (just got home from the office).

Perhaps I was using selectedFillColors and not the hyphenated css
style declaration?

I got the headers working with Lin's example, but I'd still prefer to
externalize the styles.

Dave



On Sun, 09 Jan 2005 01:41:24 +0530, Manish Jethani
<[EMAIL PROTECTED]> wrote:
>
> dave buhler wrote:
>
> > None of my attempts to change the accordian header colors (or
> > 'colours' for the Canadian/British FlexCoders) was successful within
> > my Css.
>
> Okay, here's how you set the _colours_ (Indian ;-) ) using CSS:
>
>   Accordion {
>     fill-colors: blue, white;
>     selected-fill-colors: blue, lime;
>     theme-color: blue;
>   }
>
> Manish
>
>
> Yahoo! Groups Links
>
>
>
>
>


Yahoo! Groups Links



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




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




--
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

Reply via email to