Phase 5: Finalizing the Component


You've completed all of the scripting for the Gallery component — Congratulations! You can now deploy Flash movies with the Gallery component. In this last section, you learn how to enable inspectable properties of the Gallery class to display in the Parameters tab of the Property inspector (or Component Inspector panel).

Adding the Component Definition

If you open the Library panel of the main_starter.fla document, you can see that the symbol type of the Gallery symbol is a Movie Clip. In order to convert the component to a fullfledged component (complete with component icon!), you need to specify the Gallery class in the Component Definition dialog box.

  1. With the main_starter.fla document active, open the Library panel (Ctrl+L or z+L).

  2. Right-click (or Control+click on Mac) the Gallery clip, and choose Component Definition.

  3. In the Component Definition dialog box, type com.themakers.Portfolio.Gallery in the AS 2.0 Class field, as shown in Figure 35-13. Click OK.

  4. To see the inspectable parameters, you can repeat Step 2 to see the parameters automatically created for you by Flash 8, as shown in Figure 35-14.

  5. To see the new parameters, select the cgl instance of the Gallery component on the Stage and open the Property inspector. When you select the Parameters tab, you should see the new inspectable parameters as shown in Figure 35-15.

image from book
Figure 35-13: The Component Definition dialog box

image from book
Figure 35-14: The updated Component Definition dialog box

image from book
Figure 35-15: The Parameters tab for the Gallery component

Now, you can change the thumbnail height, server host, and thumbnail script values directly in the Property inspector.

Note 

You still need to specify an items value for the Gallery instance in ActionScript code, and invoke the load() handler to initiate the thumbnail loading process.

Changing Script Paths for Final Deployment

When you're ready to deploy a Flash movie featuring the Gallery component, keep in mind that you may very likely need to change to the values used in the frame 1 script to initiate loading of the XML data from the files.php script. Make sure you specify a valid Web folder name (or path) as the dir value appended to the files.php filename in the XML.load() handler. You may also need to update the name and path to the resize.php script in the onFileData() handler written within the frame 1 script.

Web Resource 

We'd like to know what you think about this chapter. Visit www.flashsupport.com/feedback to send us your comments.




Macromedia Flash 8 Bible
Macromedia Flash8 Bible
ISBN: 0471746762
EAN: 2147483647
Year: 2006
Pages: 395

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