XML Gallery/SlideShow

Hi,
I was looking trough this great forum and this topic is closest to my problem that I can find…
Things go like this - I have a flash header that should rotate images / slideshow (fade in-out) and each of those images should have its own link on it - now problem is my boss wants flash to get images from external file (php file that “looks up” images in specific folder and “fills” xml file from which flash picks up data - so when he changes images he doesn’t need to code - just upload images in that folder) and same thing for links they should be on some external txt? file…
Now i managed to make flash that picks up images from php file and now im kinda stuck - how to add links on that images?
Is it posible and if not is there some other way to do this?
Any help or advice would be appreciated - I’m no flash expert like you ppl…

Wonderful Thread…!!!

Would someone please be kind enough to help me… its like a flash banner that slideshows images with links on it, but it needs to get image and link data from external xml file…

My gallery isnt really designed to do what you need. What you need is to do some basic XML tutorials. Once you have that down, then displaying links and rotating your banner images will be a piece of cake :wink:
http://www.kirupa.com/developer/actionscript/xmldataflash.htm

this is fantastic. I too have sene a lot of xml galleries and i made some of m aswell. but this is the best open source ive ever seen

Why not for MX? :frowning:

ahead of all, [COLOR=DarkOliveGreen]congratulations rhamej[/COLOR] for your wonderful piece of flash art!
secondly, i would like to ask two things:

  1. is it possible to show the main image preloader without first fading out the image shown? like it is done here : h**p://www.mdi-digital.com/
  2. i’m not sure, but do the loaded images remain into cache so that upon re-chosing that image it doesn’t have to preload again?

Check this:

scotty(-:

oh, scotty! thank you for your quick reply! i come across your posts quite often! and now i get the chance to talk to you and get an anwer back. thank u, i will check on that link.
cheers! :te:

hi,
I managed to make the foto gallery thanks to a tutorial I found here: http://www.kirupa.com/developer/mx2004/thumbnails.htm.
I’m just wondering how I can modify the thumbnail_mc into a thumb Holder with a specific shape (let’s say round corners and a bar on the bottom) where the images can load from the xml. Hope you can help me with this.
Thanks everyone :slight_smile:

Thumbs in the tutorial or thumbs in my source? :huh:

rhamej, is it in your plans to make this gallery support multiple image categories?

Not any time soon. I am swampped with work right now. I barley have time to take a crap :lol:

Dunno if this is the right place to ask:

I 'm using the kirupa gallery to display my images.
Works sweet, centering the images, next and prev button, nice transition. No thumbnails or stuff. Pretty simple and basic.
I want to show even a bigger images onclick in flash, so, not a popup, but the images loading in a movieclip With shadow and close button. Cant get it to work!
The hyperlink versions all open a new browser window. I just wat it to laod a movieclip or swf with the image supleid in the xml.

searching this forum for many ours now…could not find a thread ith the answer.
any help?

i’ve tried a lot of versions off
//
//getURL statement
//
picture.onRelease = function() {
loadMovie(link[p], “name of empty movieclip and so on…”);
};
//

cant get the good one…

my code:

function loadXML(loaded) {
    if (loaded) {
        xmlNode = this.firstChild;
        image = [];
        description = [];
        link = [];
        tekst = [];
        
        total = xmlNode.childNodes.length;
        for (i=0; i<total; i++) {
            image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
            description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
            //
            //adding links
            //
            link* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
            tekst* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
            //
        }
        firstImage();
    } else {
        content = "file not loaded!";
    }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("foto.php");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
    if (Key.getCode() == Key.LEFT) {
        prevImage();
    } else if (Key.getCode() == Key.RIGHT) {
        nextImage();
    }
};
Key.addListener(listen);
previous_btn.onRelease = function() {
    prevImage();
};
next_btn.onRelease = function() {
    nextImage();
};
/////////////////////////////////////
p = 0;
var cx = picture._x;
var cy = picture._y;
this.onEnterFrame = function() {
    filesize = picture.getBytesTotal();
    loaded = picture.getBytesLoaded();
    preloader._visible = true;
    preloader.preload_bar._xscale = 100*loaded/filesize;
    if (picture._width) {
        preloader._visible = false;
        if (picture._alpha<100) {
            picture._alpha += 10;
        }
        picture._x = cx-picture._width/2;
        picture._y = cy-picture._height/2;
    }
};
    //
    //getURL statement
    //
    picture.onRelease = function() {
        loadMovie(link[p], "bigpic");
    };
    //

function nextImage() {
    if (p<(total-1)) {
        p++;
        if (loaded == filesize) {
            picture._alpha = 0;
            picture.loadMovie(image[p], 1);
            desc_txt.text = description[p];
            desc_txt2.text = tekst[p];
            picture_num();
        }
    }
}
function prevImage() {
    if (p>0) {
        p--;
        picture._alpha = 0;
        picture.loadMovie(image[p], 1);
        desc_txt.text = description[p];
        desc_txt2.text = tekst[p];
        picture_num();
    }
}
function firstImage() {
    if (loaded == filesize) {
        picture._alpha = 0;
        picture.loadMovie(image[0], 1);
        desc_txt.text = description[0];
        desc_txt2.text = tekst[p];
        picture_num();
    }
}
function picture_num() {
    current_pos = p+1;
    pos_txt.text = current_pos+" / "+total;
}

Hey! Could anyone help me? How can i intergrate the autoresize of thumbs for following code (loads orginal image, and shows resized image):

function thumbnails_fn(k) {
	thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
	tlistener = new Object();
	tlistener.onLoadInit = function(target_mc) {
		target_mc._x =(target_mc._width)*k;
		//trace(target_mc._width+" "+target_mc._parent._rotation)
		target_mc.pictureValue = k;
		target_mc.onRelease = function() {
			p = this.pictureValue-1;
			nextImage();
		};
		target_mc._alpha = 50;
		target_mc.onRollOver = function() {
			this._alpha = 100;
			thumbNailScroller();
		};
		target_mc.onRollOut = function() {
			this._alpha = 50;
		};
	};
	image_mcl = new MovieClipLoader();
	image_mcl.addListener(tlistener);
	image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}

Another question is how to integrate the same function for main image. (Let’s say i have a limit - max height 340 and height 500 for example but images i upload are with variable size)… code is following:

p = 0;
var cx = picture._x;
var cy = picture._y;
this.onEnterFrame = function() {
	filesize = picture.getBytesTotal();
	loaded = picture.getBytesLoaded();
	preloader._visible = true;
	if (loaded != filesize) {
		preloader.preload_bar._xscale = 100*loaded/filesize;
	} else {
		preloader._visible = false;
		if (picture._alpha<100) {
			picture._alpha += 10;
		}
		picture._x = cx-picture._width/2;
        picture._y = cy-picture._height/2;
	}
};

[URL=“http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm”]…

xmlBanner works great from desktop, but as soon as I load all of the files onto my server I get Sandbox Security messages. Is there anyway around this.

Thanks for the cool source.