Difference between revisions of "Gallery.as"
m |
m |
||
| Line 9: | Line 9: | ||
// gallery metrics | // gallery metrics | ||
| + | originX = 10; | ||
| + | originY = 20; | ||
maxColumns = 3; | maxColumns = 3; | ||
maxRows = 4; | maxRows = 4; | ||
| Line 37: | Line 39: | ||
var thumb = _root[name]; | var thumb = _root[name]; | ||
thumb.loadMovie( thumbPath + pic[count++] ); | thumb.loadMovie( thumbPath + pic[count++] ); | ||
| − | thumb._x = x * (thumbSquare+thumbSpacing); | + | thumb._x = x * (thumbSquare+thumbSpacing) + originX; |
| − | thumb._y = y * (thumbSquare+thumbSpacing); | + | thumb._y = y * (thumbSquare+thumbSpacing) + originY; |
button.push(thumb); | button.push(thumb); | ||
} | } | ||
Revision as of 05:00, 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 originX = 10; originY = 20; 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) + originX; thumb._y = y * (thumbSquare+thumbSpacing) + originY; button.push(thumb); }
}
echo(button[0]); button[0].onPress = function() { this._alpha = 50; };
// per-frame function
function reduce() {
}



