# Customizing the header of Accordion at run-time

**URL:** <https://forum.kirupa.com/t/customizing-the-header-of-accordion-at-run-time/161463>\
**Category:** Uncategorized\
**Created:** [September 4, 2005, 6:16am UTC](https://forum.kirupa.com/t/customizing-the-header-of-accordion-at-run-time/161463 "2005-09-04T06:16:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lostchild](https://avatars.discourse-cdn.com/v4/letter/l/e9a140/32.png) [@lostchild](https://forum.kirupa.com/u/lostchild)\
**Post date:** [September 4, 2005, 6:16am UTC](https://forum.kirupa.com/t/customizing-the-header-of-accordion-at-run-time/161463/1 "2005-09-04T06:16:36Z")

</div>

I was looking for a way to customize the header color of the Accordion component. I found [[color=royalblue]this[/color]](http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004&file=00002060.html) article at macromedia and managed what i wanted to. customizing requires this class file to be included :

```auto
 
[color=black]import mx.skins.RectBorder;[/color]
[color=black]import mx.core.ext.UIObjectExtensions;[/color]
[color=black]class RedGreenBlueHeader extends RectBorder[/color]
[color=black]{[/color]
[color=black]static var symbolName:String = "RedGreenBlueHeader";[/color]
[color=black]static var symbolOwner:Object = RedGreenBlueHeader;[/color]
[color=black] [/color]
[color=black]function size():Void[/color]
[color=black]{[/color]
[color=black]var c:Number; // color[/color]
[color=black]var borderStyle:String = getStyle("borderStyle");[/color]
[color=black]switch (borderStyle) {[/color]
[color=black]case "falseup":[/color]
[color=black]case "falserollover":[/color]
[color=black]case "falsedisabled":[/color]
[color=black]	c = 0x000000; // not active[/color]
[color=black]	break;[/color]
[color=black]case "falsedown":[/color]
[color=black]	c = 0xC7BD9E; // when pressed	[/color]
[color=black]	break;[/color]
[color=black]case "trueup":[/color]
[color=black]case "truedown":[/color]
[color=black]case "truerollover":[/color]
[color=black]case "truedisabled":[/color]
[color=black]	c = 0xFF0099; // active[/color]
[color=black]	break;[/color]
[color=black]}[/color]
[color=black]clear();[/color]
[color=black]lineStyle(0, 0, 100);[/color]
[color=black]beginFill(c, 100);[/color]
[color=black]drawRect(0, 0, __width,__ height);[/color]
[color=black]endFill();[/color]
[color=black]}[/color]
[color=black] [/color]
[color=black]// required for skins[/color]
[color=black]static function classConstruct():Boolean[/color]
[color=black]{[/color]
[color=black]UIObjectExtensions.Extensions();[/color]
[color=black]_global.skinRegistry["AccordionHeaderSkin"] = true;[/color]
[color=black]return true;[/color]
[color=black]}[/color]
[color=black]static var classConstructed:Boolean = classConstruct();[/color]
[color=black]static var UIObjectExtensionsDependency = UIObjectExtensions;[/color]
[color=black]}[/color]

```

But i want to customize it at run-time and macromedia s solution is : “including the class file at compile time”. I m not good with AS2 so i dont exactly know how to reach the attributes of the header ( probably RectBorderClass ) . I d like to know if anyone has an idea on how i can do the same changes at run-time ?

cheers …
