Difference between revisions of "Gallery.as"

From Organic Design wiki
m
m
Line 37: Line 37:
 
thumb._x = x * (thumbSquare+thumbSpacing);
 
thumb._x = x * (thumbSquare+thumbSpacing);
 
thumb._y = y * (thumbSquare+thumbSpacing);
 
thumb._y = y * (thumbSquare+thumbSpacing);
thumb.onPress = function() {
 
thumb._alpha = 50;
 
};
 
 
button.push(thumb);
 
button.push(thumb);
 
}
 
}
 
     }
 
     }
 +
 +
 +
button[0].onPress = function() {
 +
this._alpha = 50;
 +
};
 +
 +
  
  

Revision as of 04:57, 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");

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-- );

var thumb = _root[name]; thumb.loadMovie( thumbPath + pic[count++] ); thumb._x = x * (thumbSquare+thumbSpacing); thumb._y = y * (thumbSquare+thumbSpacing); button.push(thumb); }

   }


button[0].onPress = function() { this._alpha = 50; };



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