ok first take a look at http://ostari.com/ronnie/airbox
my three questions are:
1. Why do my sliding thumbnails snap to the left edge the first time you load it. If you resize, it snaps, but snaps to center.
updateLocations = function () {
initialWidth = Stage.width;
initialHeight = Stage.height;
currentWidth = Stage.width;
currentHeight = Stage.height;
contentWidth = thumbSlider._width;
if (thumbSlider._width<currentWidth) {
newX = Math.round(initialWidth/2-thumbSlider._width/2);
} else {
positionContent();
newX = Math.round(initialWidth/2-thumbSlider._width/2);
}
};
updateLocations();
//the amount of space on each edge
buffer = 50;
this.onMouseMove = function() {
if ((this._xmouse>Math.floor((initialWidth-currentWidth)/2)) && (this._xmouse<Math.floor(initialWidth+2*((currentWidth-initialWidth)/2))) && (this._ymouse>thumbSlider._y) && (this._ymouse<(thumbSlider._y+thumbSlider._height))) {
if (thumbSlider._width>currentWidth) {
positionContent();
}
}
};
positionContent = function () {
mousePercent = (this._xmouse+(currentWidth-initialWidth)/2)/currentWidth;
availMovement = thumbSlider._width-currentWidth+buffer*2;
newX = Math.floor(-mousePercent*availMovement)-(currentWidth-initialWidth)/2+(buffer*2)/2;
};
if (thumbSlider._width>currentWidth) {
newX = Math.floor((initialWidth-currentWidth)/2)+buffer;
} else {
newX = Math.floor(initialWidth/2-thumbSlider._width/2);
}
holder = thumbSlider._x;
easeContent = function () {
if (newX<>thumbSlider._x) {
destx = newX;
posx = holder;
velx = (destx-posx)/4;
holder += velx;
thumbSlider._x = Math.round(holder);
}
};
thumbSlider.onEnterFrame = function() {
easeContent();
};
updateLocations();
**
2. I am using movie clip loader to load the images from an xml file, how can I make a little progress bar for each one? I know this code will do it, but how do i make a bar for each thumb loaded?**
myListener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
amount = Math.floor(((bytesLoaded/bytesTotal)*100));
loadbar._width = amount;
}
**
3. My last question is easy. My onRollOver and RollOut functions are not working. I put trace commands in there and not even those will fire. Do you see anything odd?**
var thumblength = _root.projectxml.firstChild.childNodes.length;
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
var thumbDepth = 500;
thumbplaceholder._visible = false;
for (i=0; i<thumblength; i++) {
var theThumb = "projects/thumbs/" + _root.projectxml.firstChild.childNodes*.childNodes[0].attributes.src;
thumbLoader.attachMovie("thumbHolder","thumbHolder"+i,thumbDepth+i);
myMCL.loadClip(theThumb,thumbLoader["thumbHolder"+i]);
thumbLoader["thumbHolder"+i]._x = i*120;
thumbLoader["thumbHolder"+i].onRollOver = function() {
this.alphaTo(70,0.5,"easeOutExpo");
}
thumbLoader["thumbHolder"+i].onRollOut = function() {
this.alphaTo(100,0.5,"easeOutExpo");
}
}
thanks a lot for any help