i’m using the code from the best of kirupa thread about the gallery with resize.
it’s working with what i’ve done with it so far but it’s ‘jerky’ on resize. at the last point of the resize the frame clip jumps to the correct size. I can’t seem to get a handle on why it does that.
at this point i’m using a simple clip to control the timing of the fade (if I could target fp 8, i would use the tween class and .onMotionFinished) so that there’s a slight delay between the resize and the container clip fading in the image. IF somebody could give me a better method that would be great.
Also, for the loading of the subsequent images, i was planning on using some type of timer (maybe setinterval) to wait for 10 seconds or so until I call the next xml node and load the next image. If anyone can comment on which method is best for a timer situation like that it would also be greatly appreciated.
here’s code and i’m attaching my .fla, xml and the first image (only working with that one at this point):
spacing = 20;
containerMC._alpha = 0;
theFade=0;
imagesXML=new XML();
imagesXML.ignoreWhite=true;
imagesXML.onLoad=function(success){
if(success){
rootNode=imagesXML.firstChild;
totalSlides=rootNode.childNodes.length;
firstNode=rootNode.firstChild;
trace(firstNode.attributes.url);
loadClip(firstNode);
}
}
imagesXML.load("images.xml");
loadClip=function(nextNode){
container._alpha=0;
trace(nextNode.attributes.url);
container.loadMovie(nextNode.attributes.url);
_root.onEnterFrame = function(){
var bytesT = container.getBytesTotal(), bytesL = container.getBytesLoaded();
if (bytesT != 0 && Math.round(bytesL/bytesT) == 1){
var w = container._width + spacing, h = container._height + spacing;
trace("this is the width: "+w+" this is the height: "+h);
resizeMe(w, h);
delete _root.onEnterFrame;
}
}
}
resizeMe = function(w, h){
var speed = 11;
border.onEnterFrame = function(){
border._width += (w - border._width)/speed;
border._height += (h - border._height)/speed;
if( Math.abs(border._width-w)<1){
border._width = w+spacing/2;
border._height = h;
_root.container._x = border._x - border._width/2 + spacing/2 ;
_root.container._y = border._y - border._height/2 + spacing/2;
delete border.onEnterFrame;
_root.timerClip.gotoAndPlay("start");
}
}
};