The
only resizing that you can do to a ColorPicker is through its styles:
swatchWidth
,
swatchHeight
,
backgroundPadding
,
textFieldWidth
,
and
textFieldHeight
. If you try to change the size
of the ColorPicker with the Transform tool or with ActionScript
using the
setSize()
method, or the
width
,
height
,
scaleX
,
or
scaleY
properties, these values are ignored
when you create the SWF file and the ColorPicker displays at its
default size. The palette background will resize to match the number
of columns that has been set using
setStyle()
for
the
columnCount
style. The default number of columns
is 18. You can set custom colors to 1024 and the palette will resize
vertically to match the number of swatches.
Use Styles with the ColorPicker component
You can set several styles
to change the appearance of the ColorPicker component. For example
the following procedure changes the number of columns (
columnCount
)
in the ColorPicker to 12, changes the height (
swatchHeight
)
and width (
swatchWidth
) of the color swatches,
and changes the padding for both the text field (
textPadding
)
and the background (
backgroundPadding
).
Create a new Flash file (ActionScript 3.0) document.
Drag the ColorPicker component to the Stage and give it an
instance name of
aCp
.
Open the Actions panel, select Frame 1 in the main Timeline
and enter the following code: