MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 87

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

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;
Note: Set enough data so that the scroll bars appear, or set the
Select Control > Test Movie.
7.
You can also set subcomponent skins for all components in a document by setting the skin
property on the subcomponent's
To use #initclip to apply an edited skin to all components in a document:
Follow the steps in
1.
this example, edit the ScrollDownArrowDown skin and give it the new name
MyScrollDownArrowDown.
Select File > New and create a new Flash document. Save it with a unique name, such as
2.
SkinsInitExample.fla.
Select the MyScrollDownArrowDown symbol from the library of the edited theme library
3.
example, drag it to the Stage of SkinsInitExample.fla, and delete it.
This adds the symbol to the library without making it visible on the Stage.
Select MyScrollDownArrowDown in the SkinsInitExample.fla library, and select Linkage from
4.
the Library options menu.
Select the Export for ActionScript check box. Click OK.
5.
Export in First Frame is automatically selected.
Double-click MyScrollDownArrowDown in the library to open it in symbol-editing mode.
6.
Enter the following code on Frame 1 of the MyScrollDownArrowDown symbol:
7.
#initclip 10
import mx.controls.scrollClasses.ScrollBar;
ScrollBar.prototype.downArrowDownName = "MyScrollDownArrowDown";
#endinitclip
Do one of the following to add a List component to the document:
8.
Drag a List component from the Components panel to the Stage. Enter enough label
parameters so that the vertical scroll bar will appear.
Drag a List component from the Components panel to the Stage and delete it. Enter the
following code on Frame 1 of the main Timeline of SkinsInitExample.fla:
createClassObject(mx.controls.List, "myListBox1", 0, {dataProvider:
["AL","AR","AZ", "CA","HI","ID", "KA","LA","MA"]});
Note: Add enough data so that the vertical scroll bar appears, or set
prototype
"Creating new component skins" on page
vScrollPolicy
object in the
#initclip
83, but edit a scroll bar skin. For
About skinning components
property to
section of a skin symbol.
to
vScrollPolicy
true
.
true
.
87

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents