
2003 Macromedia, Inc. 11
Populating a Combo Box with Dynamic Data
Flash comes with a set of pre-built UI components for you to use in your
UI. The first widget you will create is a Flash MX Combo Box populated
with dynamic data that you will later link to a List Box. Here you will
populate an instance of the “Combo Box” component with data from our
sample database using RemoteCatalog.
A beginning set of Flash UI components comes bundled with Flash MX.
Newer sets of components (currently at 4) may be downloaded from the
Flash MX site at a later time.
Steps
1. Return to your RemoteCatalog.fla.
Adding a Flash MX Component to the Stage
2. Expand the Components panel. Click Window Æ Components if not
open already.
3. Select Flash UI Components.
4. Drag an instance of the ComboBox component just below the
Category List text on the stage. (Don’t worry about alignment or size
for now.)
5. Open the Properties panel for the ComboBox. Click Window Æ
Components if not open already.
6. Give the ComboBox an instance name of category_cb. This is the
instance variable you will use to refer to this visual component in your
code.
Populating the Component with Dynamic Data
7. Open the Actions panel for frame 1 of the Actions layer (press F9).
8. In the functions section, create a responder function that will receive
the returned data from the getCategories() call, as follows:
Kommentare zu diesen Handbüchern