Setting the variables for the dynamic text boxes

 < Day Day Up > 



The file is now set up to receive data from the dynamic text boxes. The next step is to declare default values in the box that will appear before a user picks a song to play. To do this, set variables that are the storage containers to hold these default values. These values then pass into the dynamic text boxes on the stage.

The default values appear in the dynamic text boxes until a song in the jukebox is selected. When the song is selected, the variables update to contain the information on that song. Your first goal is to send information from the variables you set in this Flash movie and send them into the dynamic text boxes. Follow these steps:

  1. You should now be in the main movie. You need to give the title Movie Clip a distinctive instance name so we can talk to it programmatically. Select the title Movie Clip (half circle), and in the Property inspector change the instance name to title.

  2. Select Frame 1 of the Actions layer.

  3. Open the Actions panel. From the Options pop–up menu, choose Expert Mode.

  4. Click inside the right pane so you can type ActionScript. You need to set a variable that can be accessed by the title Movie Clip. To do this, you must answer two questions: What do I need to do, and where do I need to do it?

  5. What you need to do is set a variable. In the right pane of the Actions panel, type the following:

    title.title_name="Song Title Here"; title.title_artist = "Artist";
  6. Save your file. A copy is saved in the jukebox folder (in the Bonus Tutorial folder) as jukebox.fla.



 < Day Day Up > 



Macromedia Studio MX Bible
Macromedia Studio MX Bible
ISBN: 0764525239
EAN: 2147483647
Year: 2003
Pages: 491

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net