-
Load next JPEG
Hello,
I'm am trying to load images from a folder into a swf. When the next button is clicked I want the next JPEG in the folder to be loaded. Something like when button "Next" is clicked, load "imagesfolder/" +NextImage+".jpg"
Does anyone know of a good tutorial or solution?
For an example: http://www.webwasp.co.uk/tutorials/b...4/tutorial.php
Tried to do this, but couldn't get it to work right...
-
simplified:
PHP Code:
var arMyImages = new Array('dog.jpg','cat.jpg','bird.jpg','mouse.jpg','monkey.jpg');
var iShowImage = 0;
var iTotalImage = arMyImages.length - 1;
nextImage_btn.onRelease = function(){
trace('show image:' + iShowImage + ' - Total image: '+iTotalImage);
if(iShowImage < iTotalImage){
loadMovie('imagesfolder/'+ arMyImages[iShowImage], "photo_mc");
trace('what image: '+arMyImages[iShowImage]);
iShowImage++;
}else{
loadMovie('imagesfolder/'+ arMyImages[iShowImage], "photo_mc");
trace('what image: '+arMyImages[iShowImage]);
iShowImage = 0;
}
}
hope this gets you started in the right direction
IMS
-
Thanks, that worked perfectly! Also, I've been trying to get image loader to work?
Like on click preload JPEG?
I'm using this:
PHP Code:
mybutton.onRelease = function() {
infoField._visible = true;
startLoading("imagefolder/image01.jpg");
};
function startLoading(whichImage) {
loadMovie(whichImage, "imageLoader");
_root.onEnterFrame = function() {
infoLoaded = imageLoader.getBytesLoaded();
infoTotal = imageLoader.getBytesTotal();
percentage = Math.floor(infoLoaded/infoTotal*100);
infoField.text = percentage+"%";
if (percentage>=100) {
delete this.onEnterFrame;
infoField._visible = false;
}
};
}
But doesn't seem to be working either...
-
Is there a way to have a JPEG load on top of another JPEG? So while image02.jpg is being loaded, image01.jpg remains on the screen until image02.jpg is done.