7.5 Using ImageViewerDeluxe

 <  Day Day Up  >  

To try out the new ImageViewerDeluxe class, follow these steps:

  1. In Flash MX 2004 or Flash MX Professional 2004, open the imageViewer.fla we created in Chapter 5.

  2. Use Window Development Panels Actions (F9) to open the Actions panel.

  3. In imageViewer.fla 's main timeline, select frame 15.

  4. Delete all existing code from the Actions panel in that frame.

  5. Into the Actions panel, enter the following code:

     var viewer:ImageViewerDeluxe = new ImageViewerDeluxe(this, 1, 20,                                                      10, 0, 0, 3, 0xFF0000); viewer.setShowFullImage(true); viewer.loadImage("picture.jpg"); loadmsg_txt.removeTextField( ); // Removes the loading message (see frame 1). 

  6. Choose Control Test Movie. The .swf file should play, and your image should load and appear with a red border. The viewer should size itself to reveal the entire image.

If you have any trouble using the class, compare your work with the finished example files available at http:// moock .org/eas2/examples.

As with the ImageViewer class, the ImageViewerDeluxe class does not display download progress for a loading image when the image is loaded off a local hard disk. To test the preloader, be sure to post your images to a web server, and play the movie in a web browser.


 <  Day Day Up  >  


Essential ActionScript 2.0
Essential ActionScript 2.0
ISBN: 0596006527
EAN: 2147483647
Year: 2004
Pages: 177
Authors: Colin Moock

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