PDA

View Full Version : resizing slideshows



ds67
Sep 20th, 2007, 03:48 AM
Hello Everyone:

Not sure if this belongs in Javascript or Flash forum so I sent it both places. Please forgive me as I am confused.

I've been struggling with this for weeks now. I'm trying to resize photos within a slideshow using Flash. Sometimes the photos line up where they are supposed to be (centered), other times they don't. You can see what I mean at the following page. http://www.caffreytree.com/slideshow.html

All photos and flash are in the same folder. I don't understand it! Can anyone help??? The following code is used within flash...



spacing = 10;
containerMC._alpha = 0;

MovieClip.prototype.loadPic = function(pic){
_root.containerMC._alpha = 0;
this.loadMovie(pic);
_root.onEnterFrame = function(){
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1){
var w = containerMC._width + spacing, h = containerMC._height + spacing;
border.resizeMe(w, h);
delete _root.onEnterFrame;
}
}
};
MovieClip.prototype.resizeMe = function(w, h){
var speed = 3;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._width-w)<1){
this._width = w;
this._height = h;
_root.containerMC._x = this._x - this._width/2 + spacing/2;
_root.containerMC._y = this._y - this._height/2 + spacing/2;
_root.containerMC._alpha = 100;
delete this.onEnterFrame;
}
}
};



The following is what is used on the thumbnail to click and call the photos...


on(release){
containerMC.loadPic("slideshow/pic3.jpg");
}


Can anyone help?? Also, would Javascript be better for something like this instead of using Flash at all and how can I do it?

Thanks so much.
DS