
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
ImageViewer Implementation (Take 2)
|
141
• A reference to the target clip to which container_mc should be attached
• A list of depths indicating the visual stacking order of the container, image,
mask, and border clips
• The style (line weight and color) of the border around the image
Table 5-2 lists the ImageViewer class’s complete set of instance and class properties,
all of which are declared private.
The properties indicated as class properties define a single value that all ImageViewer
instances reference. Instance properties pertain separately to each instance.
The final change to our ImageViewer class comes in the constructor function, which
must define new parameters to support the new methods and properties of the class.
We must define parameters to specify:
• The position of the image (
x and y)
• The size of the mask over the image (
w and h)
• The style of the border around the image (
borderThickness and borderColor)
In addition to these new parameters, we’ll keep our original
target and depth param-
eters, so the ImageViewer constructor signature is now:
ImageViewer(target:MovieClip, depth:Number, x:Number, y:Number,
w:Number, h:Number, borderThickness:Number, borderColor:Number)
ImageViewer (Take 2), Design Summary
With the constructor redesign finished, the changes for version ...