I’m trying to make a scroller for a photo gallery and the problem is that the code below should work properly but it doesn’t!!!
when I “release” the mouse button after pressing over a thumbnail, instead of giving me it’s specific “i” it gives me “i” max +1 (in this case 37)… no matter on what thumbnail i press.
Does anyone have an explanation for this?
//////////////////////////////////////////////////////////////////////////////
var thumbWidth:Number=30;
var thumbInterspace:Number=10;
var myPics:Array=Array(36);
//filmStrip is an empty movieClip on stage
for (var i:Number = 1; i<=myPics.length; i++) {
filmStrip.attachMovie(“pic”+i, “thumb”+i, filmStrip.getNextHighestDepth());
filmStrip[“thumb”+i]._x = (i-1)*(thumbWidth+thumbInterspace);
filmStrip[“thumb”+i]._y = 10;
filmStrip[“thumb”+i].onRelease=function() {
//code here
trace(i);
}
}