//Update:
This thread contains many versions of the gallery.
The newest version can be found here.
http://www.kirupa.com/forum/attachment.php?attachmentid=48184&d=1224012876
/---------------------------------------------------------/
[quote=FlawlessDog;2171468]Here’s a zip file with everything you need,
including all three v 010+ updates.
Enjoy
version 0101 - 6 triangles
http://www.flawlessdog.com/eggzdownload/kirupa/photogallery0101/
version 0102 - 3 rectangles
http://www.flawlessdog.com/eggzdownload/kirupa/photogallery0102/
version 0103 - original scripted shape
http://www.flawlessdog.com/eggzdownload/kirupa/photogallery0103/
v 010+ updates zip - 560kb
http://www.flawlessdog.com/eggzdownload/kirupa/photogallery0101/photogallery0101.zip[/quote]
//end update:
Ok, before you get too far I am just getting started at this xml stuff.
I’ve always been weak in that, and for loops, and the cool stuff the rest
of you folks do with it. So, I plan on doing a bit of learning and see if I can’t
figure all this stuff out. I hope to keep updating this, and work towards a version
that is my own, as it were. Got a couple ideas in mind, maybe something with thisFX
I am starting where I assume at least some of you have started, and that is with:
http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm
Ok, so I have downloaded the final version, and have just been working with the scripting
that is in front of me, first. Try to get to know what it’s doing, etc.
I updated my version to flash8 and as2.0
…well, at least as much as I know how.
I changed the script so that it will “round the corner”.
In other words, when the last pic is reached, the next one will be the first again.
Also, in the back button.
Added an auto timer, though it needs to be able to be turned on and off.
Will work on that for the next version.
Also, if you start it going backwards, the auto will continue in the new direction.
Just to be different, I put the back and next function in a single function.
No real reason for it, just seeing if I could do it.
I would be interested in what you think so far…
Here’s a look at this new version:
http://www.flawlessdog.com/eggzdownload/kirupa/photogallery001/
loadXML = function(loaded):Void{
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
};
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
var myNext:Boolean=true;
var p:Number = 0;
// ///////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
myNext = false;
myImage();
} else if (Key.getCode() == Key.RIGHT) {
myNext = true;
myImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
myNext = false;
myImage();
};
next_btn.onRelease = function() {
myNext = true;
myImage();
};
// ///////////////////////////////////
myLoader = function():Void {
this.onEnterFrame = function(){
var filesize:Number = picture.getBytesTotal();
var loaded:Number = 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;
}else{
delete this.onEnterFrame;
}
}
};
};
myImage = function():Void {
//function nextImage()//
if (myNext == true){
if(p<(total-1)){
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
myLoader();
}
}else if(p >= total-1){
p=0;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
myLoader();
}
}
}else if (myNext == false){
//function prevImage()//
if(p>0){
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
myLoader();
}else if(p<=0){
p=total-1;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
myLoader();
}
}
};
firstImage = function():Void {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
myLoader();
}
};
picture_num = function():Void {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
};
/////Timer Function/////
//Set for approx 5 seconds in the Number variable myCount.
var myCounter:Number = 5;
countDown = function():Void {
myCounter--;
if (myCounter == 0){
myCounter = 5;
//clearInterval(timer);
myNext = myNext;
myImage();
}
};
//This runs the countDown() function every 1000 milliseconds(1 second)
var timer:Number = setInterval(countDown, 1000);
stop();