• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 13. Assembling the Booking Appli... > Building the Booking Facility in Fla...

Building the Booking Facility in Flash MX 2004

Now that the coding is in place and the ColdFusion Component has been written, you can start to build the booking facility. This is the easiest part of the job. To build an interactive reservation facility in Flash MX 2004, follow these steps:

Open Flash MX 2004. When the application opens, change the canvas in the Property Inspector to 550 pixels wide by 480 pixels high. Set the background color to white—#FFFFFF—in the Property Inspector.

Insert three new layers in the timeline by clicking the Insert Layer button. Rename the layers, from the top layer down, Scripts, Buttons, Layouts, and Facilities. When finished, your screen should resemble that shown in Figure 13.7.

Figure 13.7. The movie is sized and the layers are named and in their proper order.

With the layers defined, it is time to incorporate the booking.as script into this movie and to stop the movie from looping.

Click once in frame 1 of the Scripts layer and press the F9 key to open the Actions panel. Type the following script into the text input area:

#include "booking.as"

Close the Actions panel.

This line of code calls the booking.as file created earlier in Dreamweaver.

Add a new keyframe in frame 5 of the Scripts layer. Select the frame and open the Actions panel. Enter the following:


Close the Actions panel. The stop action is added to frame 5 to prevent the playback head from looping and reloading the code every time it arrives in frame 1 of the movie.

With the first frame of the movie “loading” the booking.as code and the playback head stopped on frame 5, you can now turn your attention to building the interface. The list of the facilities to be booked will appear in a pop-down menu box.

Those facilities will be pulled from the MySQL database by the booking.as script interacting with the ColdFusion MX Component and will automatically populate the menu. In this manner, you can add new facilities to the community center and only have to change the MySQL database. The changes made will appear in the menu. This menu is already built for you. The ComboBox component is the ideal solution for this task.

Drag a ComboBox component from the UI Components panel to frame 1 of the Facilities layer. When the ComboBox appears on the canvas, drag it to the upper-right corner of the canvas. Add a blank frame in frame 5 of the Facilities layer.

With the ComboBox component selected, give the instance the name of facilitiesList in the Property Inspector.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint