GridGallery

Kind of class: public class
Package:
Inherits from:
  • Sprite
Known subclasses:
Version: 7 Mar 2010
Author: John Polacek, john@johnpolacek.com
Classpath: com.johnpolacek.components.GridGallery
File last modified: Thursday, 24 February 2011, 22:09:57
Loads an array of thumbnails and arranges them in a grid. Clicking on a thumbnail launches content from a corresponding array in a lightbox window.
Example

  • Create grid gallery 8 images wide x 3 images high with 1 pixel spacing, then use build method to create - 1st param is array of thumbs, 2nd is array of content
    var gallery:GridGallery = new GridGallery(8, 3, 1); 
    gallery.build(["thumb1.jpg","thumb2.jpg"...], ["image.jpg","video.flv"...]);
    

Summary

Constructor
Instance properties
Instance methods

Constructor

GridGallery

function GridGallery(w:int, h:int, s:int)
Parameters
 

Instance properties

baseAlpha

baseAlpha:Number = .8(read,write)

Alpha of thumbnail

centerGrid

centerGrid:Boolean = false(read,write)

If true, grid is centered to the size of the stage. Default false.

gridX

gridX:int(read,write)

X position of grid. Default is 0.

gridY

gridY:int(read,write)

Y position of grid. Default is 0.

lightboxFormat

lightboxFormat:LightboxFormat = new LightboxFormat()(read,write)

LightboxFormat object

rolloverAlpha

rolloverAlpha:Number = 1(read,write)

Rollover alpha of thumbnail

Instance methods

build

function build(thumbnails:Array, content:Array) : void

Builds the grid and lightbox. Thumbnail button array corresponds to the content array. thumbnails[5] opens content[5]

Parameters
 

onButtonSelect

function onButtonSelect(event:UIEvent) : void

onGridLoadComplete

function onGridLoadComplete(event:Event) : void

Image load complete handler

setSize

function setSize(w:int, h:int) : void