Difference between revisions of "Gallery.as"
m |
m |
||
Line 15: | Line 15: | ||
// TODO get this from socket or GET | // TODO get this from socket or GET | ||
var pic = new Array(); | 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"); |
Line 25: | Line 25: | ||
for ( x = 0; x < maxColumns; x++) { | for ( x = 0; x < maxColumns; x++) { | ||
for ( y = 0; y < maxRows; y++) { | for ( y = 0; y < maxRows; y++) { | ||
− | + | temp = new thumb( _root, layer--, thumbPath + pic[count++], x * (100+thumbSpacing), y * (100+thumbSpacing)); | |
} | } | ||
Line 48: | Line 48: | ||
} | } | ||
− | something = new thumb( _root, layer--, "/w/angela-images/small/purple.jpg", 10, 10 ); | + | //something = new thumb( _root, layer--, "/w/angela-images/small/purple.jpg", 10, 10 ); |
Revision as of 02:45, 11 April 2006
- include 'debug.as';
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;
// 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");
count = 0;
for ( x = 0; x < maxColumns; x++) { for ( y = 0; y < maxRows; y++) { temp = new thumb( _root, layer--, thumbPath + pic[count++], x * (100+thumbSpacing), y * (100+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;
this.onRollOver = function() { this.thumb._alpha = 60; };
this.onRollOut = function() { this.thumb._alpha = 100; };
}
//something = new thumb( _root, layer--, "/w/angela-images/small/purple.jpg", 10, 10 );
// per-frame function function reduce() { }