Graphics Reference
In-Depth Information
class. When you look at them in the code, you might notice that they
appear to be in two groups separated by an empty line. The only
reason I did that is because the first group are the variables that are
immediately set inside the SimpleGallery class constructor. So let
'
s
take a look at these variables now in Table 12.4.
The SimpleGallery class constructor doesn
t have a huge
amount of code in it. The first thing it does is to set some of the
private variables based on the parameters that are passed in. The
six parameters used in the constructor are evenly split between
required and optional. The first three ( parent, galleryPath, and
imageArray ) need values from you when you create a new instance
of the SimpleGallery. The other three ( columns, thumbScale, and
padding )aren
'
t as dependent and needy. Instead, they each have
default values (1, 1, and 5, respectively), which, when left
'
Table 12.4 The Private Variables of the
SimpleGallery Class
Variable
Purpose
_galleryParent (DisplayObjectContainer)
The parent of the gallery
_galleryPath (String)
The path to the external directory that holds the images
_imageArray (Array)
An array of image names located within the external directory
_columns (int)
The number of columns in which to layout the gallery
_thumbScale (Number)
The scale the thumbnail should be in relation to the original image
_padding (Number)
The number of pixels to place between the images
_numberOfImages (int)
The number of images in the gallery
_numberLoaded (int)
The number of images that have completely finished loading
_imageLoader (Loader)
Used to load and manipulate the images
_loadedImage (Loader)
Used to reference each image as it has finished loading
_targetScale (Number)
Used to scale the images up and down when the user interacts with them
_targetX (Number)
Used to set and move the x position of an image that a user is
interacting with
_targetY (Number)
Used to set and move the y position of an image that a user is
interacting with
_halfWidth (Number)
Half the width of the gallery; used for placement of an image as it is
interacted with
_halfHeight (Number)
Half the height of the gallery; used for placement of an image as it is
interacted with
_imageNamePrefix (String)
Used as the first part of the name of each image as it is loaded and
placed in the gallery
_pointVector (Vector)
A Vector containing the Points to use for the placement of each image
_imagesURLRequest (URLRequest)
Used to load each image
Search WWH ::




Custom Search