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

Chapter 14. Using ActionScript Behaviors > Using the Load Graphic Behavior

Using the Load Graphic Behavior

Once you have the JPEG images safely tucked away in their own folder, you can turn your attention to the design of the front end. For starters, you will need a defined area that is the same width and height of the graphics, and a button object to attach the Load Graphic Behavior. When you insert the Load Graphic behavior, Flash will need to know the full path name to the image file. For example, if the images reside in a folder named photos, on the server www.images.com, the full path name would be: http://www.images.com/photos/filename.jpg, with filename.jpg being the name of the image file.

Use the Load Graphic Behavior

Click Insert, and then click New Symbol.

Select the Movie Clip option, and then name the Symbol.

Click OK.

Leave the Movie Clip behavior untouched, and click the Scene button to return to the active scene.

Select the layer to hold the movie clip.

Drag the movie clip onto the Stage, and position it in the upper-left corner of the box reserved for the image, and then select the movie clip.

Enter a unique instance name for the movie clip.

Select the Button object.

Click the Add button (+) in the Behaviors panel, point to Movieclip, and then click Load Graphic.

Enter the full path name to the .jpg file.

Select the unique instance name for the movie clip.

Click OK.

Click the Event list arrow, and then click an event to trigger the Load Graphic Behavior.

Click the Control menu, and then click Test Movie to test Load Graphic.

Flash displays the graphic.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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