I simply made an accordion header class, and put this in there:
class com.inco.controls.vAccordionHeader extends
mx.containers.accordionclasses.AccordionHeader {
public var content_mc:UIObject;
function layoutContents(offset:Boolean):Void
{
if(this["content_mc"] == this._parent.selectedChild) {
this.labelPath.textColor =
this._parent.getStyle("highlightColor");
} else {
this.labelPath.textColor =
this._parent.getStyle("color");
}
super.layoutContents();
this.content_mc._yscale = 100;
this.content_mc._xscale = 100;
this.content_mc._height -=1;
}
}
I noticed a possible bug in that for some reason in the last Accordion
Header, the bottom "border" isn't shown (ie last content_mc overlaps
it).
Also HighLightColor seems to be ignored (*that and fillColors attr*).
At anyrate, highlightColor is an attribute i went with in my
mx:Accordion tag, but you can substitute it for your own (ie you'll
probably need to extend the mx Accordion tag to put in your own
Attributes ..
On 6/24/05, Manish Jethani <[EMAIL PROTECTED]> wrote:
> On 6/24/05, Ashish Goyal <[EMAIL PROTECTED]> wrote:
>
> > 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);
> > }
> >
> > }
>
> I'd do something like the above in the handler for the accordion's
> 'change' event. Set the color of the currently selected one and reset
> the one for the last selected one (no need to iterate over all
> children).
>
>
> --
> 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
>
>
>
>
>
>
>
>
--
Regards,
Scott Barnes
http://www.mossyblog.com
http://www.flexcoder.com ("Waiting for FLEX NCL to arrive")
--
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/