Flash UI Components
Flash Components
A Flash Component is a special type of Movie Clip Symbol included in Flash that is already programmed for performing certain actions.
**Note: When using the same Flash Component multiple times in a single movie, you should only drag one copy of the Component from the Components panel. All additional instances of that component used in the movie should be brought in from the Library.
All Components should be given an instance name in the Properties panel.
Creating a Scrollbar with a Text Field
- Open or create a new movie.
- Click on Insert > New Symbol…
- Create a Symbol with a Movie Clip behavior. Click OK.
- In the Symbol Edit Mode, add a layer. Name one layer GRAPHIC and the other layer TEXT. In the GRAPHIC layer, draw the background for your scroll box. In the TEXT layer, type in your text.
- Click on the Scene 1 link to return to the movie.
- Open the Library & drag the new movie clip symbol onto the stage.
- Select the Modify menu and choose Break Apart.
- Click on the Text box & open the Properties panel.
- Change the text type from Static to Dynamic and give the instance a name such as TEXT.
- Change the line type from Single to Multiline.
- Using the Text tool, select all text, double click the small white resize bar & resize the textbox to the desired size for the scroll box.
- Open the Components panel and drag the scrollbar component into the textbox. The scrollbar will resize itself to fit the textbox.
- Select Control > Test Movie to try the finished scrolling text box.
Creating a Combo Box with URL links.
- 1. Add two layers to your movie named “Combo Box” and “Actions”.
- Open the Components panel and drag a combo box onto the stage in the appropriate layer.
- Give the instance a name in the Properties panel.
- Double-click in the Label line in the Properties panel to open the Values box. Click the + to add the desired number of values to the combo box.
- Click next to the value numbers and type in names for each value. (0 is the default value that will be displayed in the box). Click OK.
- Double-click in the Data line in the Properties panel to open the Values box. Click the + to add the necessary number of values to correspond to their labels in the combo box.
- Click next to the value numbers and type in the URLs. Click OK.
- Click in the Change Handler line and add a name for the function to be created later such as “urlfunction”. A Change Handler calls a block of code.
- In the first frame of the Actions layer, add the following actions from the Actions panel. Open the Actions book, then the User Defined Functions book. Double-click on Functions to add it to the Layer.
- In the Name field type in the name you gave the Change Handler from step 8.
- Open the Browser/Network book and double-click on getURL. Place a check next to the URL field in the Expressions box.
- Open the Flash UI Components book and then open FComboBox, then Methods. Double-click on getSelectedItem.
- Click in the URL box in front of the period (.) and click on the Target icon.
- Select from the Target list the instance name of your ComboBox from step 3.
- To direct the Change Handler to use the data entered for each value, you must add “.data” after the () next to url.getSelectedItem. See ActionScript below.
function urlfunction() {
}
getURL(url.getSelectedItem().data);
