Graphics Reference
In-Depth Information
The change in size happens instantaneously in the imageClicked
method, and you may want to consider adding in a tiny bit of
math for transitions or even looking into one of the popular
tweening libraries like Tweener or TweenLite.
SimpleGallery Code
package com.flashadbook.display {
import flash.display.DisplayObjectContainer;
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.geom.Point;
import flash.net.URLRequest;
import flash.events.Event;
import flash.events.IOErrorEvent;
public class SimpleGallery extends Sprite{
private var _galleryParent:DisplayObjectContainer;
// the parent of the gallery
private var _galleryPath:String; // external folder
that holds the images
private var _imageArray:Array; // array of image
names within the _galleryPath
private var _columns:int; // number of columns for
the gallery
private var _thumbScale:Number; // percentage to
shrink the image for the thumbnail
private var _padding:Number; // the amount of space
between menu items
private var _numberOfImages:int; // number of
images in the gallery
private var _numberLoaded:int; // how many images
have finished loading
private var _imageLoader:Loader; // used to load
and manipulate each image
private var _loadedImage:Loader; // used to
reference each image as it is loaded
private var _targetScale:Number; // used to scale
images up and down
private var _targetX:Number; // used to move the x
position of a selected image
private var _targetY:Number; // used to move the y
position of a selected image
private var _halfWidth:Number; // half the width of
the gallery
private var _halfHeight:Number; // half the height
of the gallery
Search WWH ::




Custom Search