User Guide

104 Customizing Components
If you want to change a specific scroll bar in a document, enter the following code in
the Actions panel on Frame 1 of the Timeline:
import mx.controls.List
import mx.controls.scrollClasses.ScrollBar
var oldName = ScrollBar.prototype.downArrowDownName;
ScrollBar.prototype.downArrowDownName = "MyScrollDownArrowDown";
createClassObject(List, "myList1", 0, {dataProvider: ["AL","AR","AZ",
"CA","HI","ID", "KA","LA","MA"]});
myList1.redraw(true);
ScrollBar.prototype.downArrowDownName = oldName;
7.
Select Control > Test Movie.
You can also set subcomponent skins for all components in a document by setting the skin
property on the subcomponent’s
prototype object in the #initclip section of a
skin symbol.
To use #initclip to apply an edited skin to all components in a document:
1. Follow the steps in “Creating new component skins” on page 99, but edit a scroll bar skin.
For this example, edit the ScrollDownArrowDown skin and give it the new name
MyScrollDownArrowDown.
2. Select File > New and create a new Flash document. Save it with a unique name, such as
SkinsInitExample.fla.
3. Select the MyScrollDownArrowDown symbol from the library of the edited theme library
example, drag it to the library of SkinsInitExample.fla.
This adds the symbol to the library without making it visible on the Stage.
4. Select MyScrollDownArrowDown in the SkinsInitExample.fla library, and select Linkage
from the Library options menu.
5. Select the Export for ActionScript check box. Click OK.
Export in First Frame should be automatically selected; if it is not, select it.
6. Double-click MyScrollDownArrowDown in the library to open it in symbol-editing mode.
7. Enter the following code on Frame 1 of the MyScrollDownArrowDown symbol:
#initclip 10
import mx.controls.scrollClasses.ScrollBar;
ScrollBar.prototype.downArrowDownName = "MyScrollDownArrowDown";
#endinitclip
NOTE
Set enough data so that the scroll bars appear, or set the vScrollPolicy property
to
true.