To create an ActionScript-customized Accordion header skin:
1.
Create a new ActionScript class file.
For this example, name the file RedGreenBlueHeader.as.
2.
Copy the following ActionScript to the file:
import mx.skins.RectBorder;
import mx.core.ext.UIObjectExtensions;
class RedGreenBlueHeader extends RectBorder
{
static var symbolName_str:String = "RedGreenBlueHeader";
static var symbolOwner_obj:Object = RedGreenBlueHeader;
function size():Void
{
var color_num:Number; // Color
var borderStyle_str:String = getStyle("borderStyle"); // Attribute of
Accordion
// Define the colors of each tab in the Accordion for each tab state.
switch (borderStyle_str) {
case "falseup":
case "falserollover":
case "falsedisabled":
color_num = 0x7777FF;
break;
case "falsedown":
color_num = 0x77FF77;
break;
case "trueup":
case "truedown":
case "truerollover":
case "truedisabled":
color_num = 0xFF7777;
break;
}
// Clear default style and draw custom style.
clear();
lineStyle(0, 0, 100);
beginFill(color_num, 100);
drawRect(0, 0, __width, __height);
endFill();
}
// required for skins
static function classConstruct():Boolean
{
UIObjectExtensions.Extensions();
44
Accordion component (Flash Professional only)
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers