MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Manual page 41

Developing flex components and themes in flash authoring
Table of Contents

Advertisement

Add a second layer called assets, and add a second blank keyframe to this layer.
5.
Return to the main FLA file.
6.
Insert a new symbol by selecting Insert > New Symbol. The Create New Symbol dialog box
7.
appears. This new symbol will be the new skin.
In the Create New Symbol dialog box, do the following:
8.
Select the MovieClip for Behavior option (the default).
a
Select the Export for ActionScript check box.
b
Enter a symbol Name.
c
Do not specify an AS 2.0 Class name or an Identifier for this symbol. For more information
on creating a new symbol, see
Clear the Export in First Frame check box.
d
Draw the new skin on the second symbol's Stage in Edit Symbols mode. The new skin can be
9.
a simple graphic or a composite of MovieClips.
Return to Edit Symbols mode and edit the component's symbol (the first symbol you created).
10.
Drag the skin symbol you created onto the second frame of the component's assets layer.
11.
Create a new ActionScript class file. In this file, extend the existing control, set the value of the
12.
skin to the new skin name, and apply the skin as a clip parameter in the
method.
The following example overrides the
new Button control called SkinnedButton:
class SkinnedButton extends mx.controls.Button {
// Set the value of the falseUpSkin state to the new skin.
var falseUpSkin:String = "redbox";
static var symbolName:String="SkinnedButton";
static var symbolOwner:Object = SkinnedButton;
var className:String = "SkinnedButton";
function SkinnedButton() {
}
function init() {
super.init();
invalidate();
}
static var clipParameters:Object = { redbox:1 };
function constructObject2(o:Object):Void {
super.constructObject2(o);
applyProperties(o, SkinnedButton.clipParameters);
}
}
"Adding new symbols" on page
skin with the symbol named redbox in a
falseUpSkin
12.
constructObject2()
Skinning custom components
41

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX - DEVELOPING COMPONENTS AND THEMES and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flex

Table of Contents