PDA

View Full Version : Photo gallery Help


digitalmalcolm
08-26-2005, 12:38 PM
I need help Creating this gallery using panning effect linking to individual images.

http://matthewjordansmith.com/


var myArray:Array = new Array(1000);
var index:Number = 0; // stores array index of leftmost MC
var maxImages:Number = Math.ceiling(stageWidth / (numImages * (25 + xSpacing) + xSpacing)); // there are numImages + 1 spaces drawn

function draw() { // draws the images onto the stage
for(var i = index; i < maxImages; i++) {
myArray[i]._x = i * (xSpacing + 25) + xSpacing;
}
}
function left() {
index = (index - 1) % maxImages;
draw();
}

function right() {
index = (index + 1) % maxImages;
draw();
}

Wino
08-26-2005, 01:43 PM
where did you define xspacing?