Difference between revisions of "Gallery.as"

From Organic Design wiki
m
m
Line 10: Line 10:
 
maxRows = 4;
 
maxRows = 4;
 
thumbSpacing = 10;
 
thumbSpacing = 10;
 +
thumbSquare = 100;
  
 
// list of images
 
// list of images
Line 30: Line 31:
 
for ( y = 0; y < maxRows; y++) {
 
for ( y = 0; y < maxRows; y++) {
 
for ( x = 0; x < maxColumns; x++) {
 
for ( x = 0; x < maxColumns; x++) {
var temp = new thumb( _root, layer--, thumbPath + pic[count++], x * (100+thumbSpacing), y * (100+thumbSpacing));
+
var name = "thumb" + count;
button.push(temp);
+
_root.createEmptyMovieClip( name, layer-- );
}
+
thumb = _root[name]
 +
thumb.loadMovie( pic[count] );
 +
button.push(thumb);
 +
}
 
     }
 
     }
 +
 +
//new thumb( _root, layer--, thumbPath + pic[count++], x * (thumbSquare+thumbSpacing), y * (thumbSquare+thumbSpacing));
 +
  
 
function thumb( parentMovieClip, layer, imageUrl, x, y ) {
 
function thumb( parentMovieClip, layer, imageUrl, x, y ) {

Revision as of 03:18, 11 April 2006

layer = 99999;

// paths in webspace for image access imageRoot = "/w/angela-images"; thumbPath = imageRoot + "/small"; imagePath = imageRoot + "/big";

// gallery metrics maxColumns = 3; maxRows = 4; thumbSpacing = 10; thumbSquare = 100;

// list of images // TODO get this from socket or GET var pic = new Array(); pic.push( "/purple.jpg"); pic.push( "/purple.jpg"); pic.push( "/purple.jpg"); pic.push( "/purple.jpg"); pic.push( "/purple.jpg"); pic.push( "/purple.jpg"); pic.push( "/purple.jpg"); pic.push( "/purple.jpg"); pic.push( "/purple.jpg");

count = 0;

button = new Array();

for ( y = 0; y < maxRows; y++) { for ( x = 0; x < maxColumns; x++) { var name = "thumb" + count; _root.createEmptyMovieClip( name, layer-- ); thumb = _root[name] thumb.loadMovie( pic[count] ); button.push(thumb); }

   }

//new thumb( _root, layer--, thumbPath + pic[count++], x * (thumbSquare+thumbSpacing), y * (thumbSquare+thumbSpacing));


function thumb( parentMovieClip, layer, imageUrl, x, y ) {

   var name = 'thumb'+layer;
   parentMovieClip.createEmptyMovieClip( name, layer );
   this.thumb = parentMovieClip[name];
   this.thumb.loadMovie( imageUrl );
   this.thumb._x = x;
   this.thumb._y = y;
   }


// per-frame function function reduce() { }