
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Moving Right Along
|
223
Using ImageViewerDeluxe
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 exam-
ple 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.
Moving Right Along
The ImageViewerDeluxe ...