Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Tutorial Question On: "Photo Gallery Using XML And Flash"



This tutorial is awsome. But I have furthur things I need to do with this system. The image I have for the slideshow are long and require me to create a scroll bar in order for the viewer to see the rest of the image. I dont need to scroll horizontally just vertically. My attempts so far have been futile. Also I need to have a list box with the captions of all the images in it so that I can click on the image I want from a list. Any ideas?



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 11-10-2004, 03:25 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Photo Gallery Using XML And Flash Tutorial
I have used the Tutorial to build what I basically wanted, one thing though, how do you add another xml entry for picking up the relevant field in the xml doc?

Here is the code and the //NOTE is where I have added the code that I thought would work.

Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
body = [];//NOTE
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
body[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;//NOTE
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("tester.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function()
{
if (Key.getCode() == Key.LEFT)
{
prevImage();
}
else if (Key.getCode() == Key.RIGHT)
{
nextImage();
}

}
Key.addListener(listen);
mcPrevious.onRelease = function()
{
prevImage();
}
mcNext.onRelease = function()
{
nextImage();
}
/////////////////////////////////////
p = 0;
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;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
body_txt.text = body[p];//NOTE
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
body_txt.text = body[p];//NOTE
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
body_txt.text = body[0];//NOTE
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
My entry in the xml file is called <body>This is the body description</body>

I am hoping someone can help me out?

Thanks in advance

XML + Flash Photo Gallery Tutorial Help
hi. i just came across the tutorial mentioned above and it was the ideal thing i needed for my site.

i have a question though..

i want each image that opens up from the scrolling thumbnails below to have another set buttons relating to the main image. for instance:

A 1 2 3

<--a-b-c-d-e-->

lower case = scrolling thumbnails
upper case = big image
numbers = buttons linked to another set of external images that are related to the big image.

the problem is i don't know what controls the thumbnail/main image when i click on the scroller (i'm kinda lost in the code). so right now i have only one set of numbers regardless of which big image opens up.

what would be the best way to go about this?

thanks.

Photo Gallery Using XML And Flash Tutorial Help
I need a little help. I need to use this tutorial (http://www.kirupa.com/developer/mx20...otogallery.htm) for what i am doing but cant seem to figure out how to do the rest.
So here's what I am trying to accomplish:

I need to figure out they did this image gallery?
http://www.kellymoorephotography.com/index2.php

or something like this that is similar:
http://www.bludomain.com/photo25/index2.php

I can't figure it out.

How do they load in the images, colors, and the resizing the frame.

I want to make it as easy as possible for my dad who is a photographer to manage as possible and if i can, i just want a specific location for him to upload the formatted photos. In three or so separate galleries or folders.

Can somebody help me to learn how to do this?

Thanks!
Austin

XML + Flash Photo Gallery Tutorial - Help
Can someone tell me how I can correct the size of my thumbnails and larger images pls. I have attached the fla file and the flash player file in this zip file. I've got everything else working but I am not sure what script to use to adjust the image size to the actual file size.

I used the http://www.kirupa.com/developer/mx2004/thumbnails.htm tutorial for vertical scroll but the images are not the right size?

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.UP) {
prevImage();
} else if (Key.getCode() == Key.DOWN) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
// centers the big image
function centerImage(){
picture._y = Stage.height / 2 - picture._height / 2;
}
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
centerImage();
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
centerImage();
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._xmouse>=thumbnail_mc._x) && (_root._xmouse<=thumbnail_mc._x+thumbnail_mc._widt h)) {
if ((_root._ymouse>=(hit_right._y-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._y -= scroll_speed;
} else if ((_root._ymouse<=(hit_left._y+40)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._y += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}

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

Flash 8 & XML Photo Gallery Tutorial
I am attempting the Kirupa XML and Flash Photogallery tutorial in Flash 8. Whenever I do the Publish Preview my captions simply say "Undefined" and the animation doesn't work. It seems the XML file isn't being recognized. All files are saved in the same folder and all code appears to match up. I am assuming this is due to my using Flash 8. How can I fix this? (I am using actionscript 2.0)

Using XML And Flash Photo Gallery Tutorial
I am in the process of learning more about flash and its capabilities. My main goal is to create a photo gallery with the scrolling thumbnails. I have decided to go one step at a time and started with making a simple photo gallery. There are a few questions I have about that tutorial but I will save it for later because they are not critical. I was able to successfully create a simple photo gallery.

I have gone through step by step in the "Photo Gallery Using XML and Flash" tutorial and have been unsuccessful. I am not sure if it has to do with my images.xml file. It says to create a xml file using an ASCII formatted text document such as notepad.

Can Microsoft Word be used as well?

I have copied and pasted everything word for word, as well as the copy to be placed on the actions layer in the fla file. I am not sure what I could be doing wrong. When I go to publish as it instructs at end of page 2 of the tutorial, no photos come up and the dynamic text #2 field says "undefined." It seems that when I open the swf file it does the same thing and an error message comes up saying that the path is undefined.

I have saved everything to the same folder on my hard drive and have repeatedly tried to create this photo gallery using the tutorial. I know that once I get past this that it is as simple as changing the code in the xml file to read to my photos. Any help and suggestions would be appreciated.

Thank you

XML + Flash Photo Gallery Tutorial
I am following this tutorial, http://www.kirupa.com/developer/mx20...otogallery.htm.

I need to download the partial FLA files, but I can't open them in flash. Could somebody give me the steps or codes to put the preloader in my gallery?

Thanks in advance.

Help With XML/Flash Photo Gallery Tutorial
In the XML/Flash Photo Gallery Tutorial how do I turn the main image into a link? For example go to http://www.mytowny.com/portfolio.html. When the main image of the dog comes up, how can I turn that into a button to go to another site. Any help would be awesome. thanks!

Flash Mx Tutorial For Photo Gallery
http://www.kirupa.com/developer/mx/photogallery.htm

I am having trouble understanding the backward and forward buttons part. Where exactly do these buttons go? My photo gallery works...except the forward and backward buttons didn't appear...thus I can only see the first picture....Can someone help me with the creating backward and forward buttons part? I am getting frustrated...

Thanks,

AL
"Live the moment because yesterday is gone and tomorrow may never come"

Photo Gallery Using XML And Flash Tutorial
I have used the Tutorial to build what I basically wanted, one thing though, how do you add another xml entry for picking up the relevant field in the xml doc?

Here is the code and the //NOTE is where I have added the code that I thought would work.

Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
body = [];//NOTE
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
body[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;//NOTE
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("tester.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function()
{
if (Key.getCode() == Key.LEFT)
{
prevImage();
}
else if (Key.getCode() == Key.RIGHT)
{
nextImage();
}

}
Key.addListener(listen);
mcPrevious.onRelease = function()
{
prevImage();
}
mcNext.onRelease = function()
{
nextImage();
}
/////////////////////////////////////
p = 0;
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;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
body_txt.text = body[p];//NOTE
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
body_txt.text = body[p];//NOTE
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
body_txt.text = body[0];//NOTE
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
My entry in the xml file is called <body>This is the body description</body>

I am hoping someone can help me out?

Thanks in advance

Xml & Flash Photo Gallery Tutorial Question
http://www.kirupa.com/developer/mx20...otogallery.htm

I got it all working and stuff, but i would like it if i could link the image that being displayed.

does anyone know how that could be done?
thanks so much in advance!

Trouble With The Photo Gallery Using XML And Flash Tutorial.
Hello Kirupa forumers,

I am currently having trouble with my photo gallery as it is not loading my images. I have followed the Kirupa tutorial and yes I have edited the Xml file but it's still not loading. Is there a percific format example: .jpg, .gif etc. ?
Please help me on this one.

Thanks.
Dan.

Photo Gallery Using XML And Flash Tutorial Question
I was going through the Kirupa tutorial on this and was wondering if there was a way to change the center location where the image loads. Right now the images load with the top left corner being the point of loading, which would work if I was using just hozizontal images but when loading vertical images, things don't line up. So, my question is there a way to set it to where the loading point is the center of the image, so either vertical and horizontal images load in the same area. Thanks for the help!

Photo Gallery Using XML And Flash Tutorial Question
Hi,
Your tutorial "Photo Gallery Using XML and Flash" is grrreat! Thanks.
I have one question. I would like my photo gallery to auto advance instead of using a button to move to the next photo & caption. How would I change the code to do this? I use MX 2004.
Thanks,
Joy

Tutorial Problems: 'Photo Gallery Using XML And Flash'
Hi,

Im trying to create a photo gallery using XML and Flash MX 2004 (on a Mac OS 10.3.7).

I've followed the tutorial -

http://www.kirupa.com/developer/mx20...otogallery.htm

- and have created the gallery though none of my pictures are visible in the gallery. I've created the XML file in 'Simpletext' which looks like this:


<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>http://www.yetiintelligence.com/photos/one.jpg</image>
<caption>no picture?</caption>
</pic>
<pic>
<image>http://www.yetiintelligence.com/one.jpg</image>
<caption>?????</caption>
</pic>
<pic>
<image>http://www.kirupa.com/developer/mx2004/pg/stata.jpg</image>
<caption>Stata Center</caption>
</pic>
<pic>
<image>http://www.kirupa.com/developer/mx2004/pg/stata_lobby.jpg</image>
<caption>Stata Lobby</caption>
</pic>
<pic>
<image>http://www.kirupa.com/developer/mx2004/pg/construction.jpg</image>
<caption>Construction</caption>
</pic>
<pic>
<image>http://www.kirupa.com/developer/mx2004/pg/dome.jpg</image>
<caption>The Dome</caption>
</pic>
<pic>
<image>http://www.kirupa.com/developer/mx2004/pg/structure.jpg</image>
<caption>Structure</caption>
</pic>
</images>



(Notice only the first two images in the XML file have been changed to my own pictures, these are the only two that don't work?!) I have the jpg's saved in a folder on my ftp server called 'photos'... you can test they work by just typing the url directly into a browser:

http://www.yetiintelligence.com/photos/one.jpg

But they don't seem to load up in the gallery?

http://www.yetiintelligence.com/xml_...lery_user.html


Any ideas what im doing wrong???

Thanks,

B.

RE: Photo Gallery Using XML And Flash Tutorial - Variation
Awesome tutorial... helped me SOOOOO much

One question... amonst other things, I've created a bulitin (sorry about the spelling) board for our Home LAN using the Photo Gallery Using XML and Flash tutorial, adding another 4 or so description boxes to create an area on the homepage to send notes to each other (using a seperate CGI/Perl script from another page to remotely edit the XML file) and having the image as a photofit which changes so that you know who its from.
However...
Because it is a bulitin board, we would get more from it having the most recent post at the front.

I've tried to fiddle with the code so that when the flash movie loads it loads the last Node from the XML file (what would be the last photo from the album/slideshow) but i just cant get it to work properly...

I know that because of how XML is coded, to use 'currentNode = total' I would need to add a '-1' to the end to counteract the fact that XML counts from 0 upwards rather than 1 upwards.

This is fine, and I can get it to display the final post, but it still believes it is the first post so despite it showing all the info from the last Node in the XML, it will not allow you to view the previous post and upon clicking the next button it jumps to Node 2, as it would if starting from the start.

Hopefully I have made this as clear as possible lol!!! anyway, if anyone has any ideas it would be most appreciated - been working on it all night (about 6 hours) lol!



P.S. I can submit the files if necassary...

digitalgravy

Photo Gallery Using XML And Flash Tutorial By Kirupa
ok this is the deal.. i did the tutorial on here of the photo gallery using xml with thumbnails, and i can't get my pictures to be centered. Im in desperate need of some help.. to see what i mean check out this link http://www.priscillamarie.com/private/photos.html

the FLA is too big so if you think you can help i will email it too you....



Kurve

Question About Photo Gallery Using XML And Flash Tutorial
http://kirupa.com/developer/mx2004/x...otogallery.htm

Hi guys, im new to these forums and to flash so please be patient with me. Well my question is that i am trying to use XML and Flash to create a photo gallery but i would like it to be automated. Instead of having to click on the next and back buttons to switch the pics i would like for them to change automatically by defined command. This tutorial hlped and is actually exactly what i want to do but without the next and back buttons. If any one has any clue your feedback is appreciated. Ty

Problem With The Tutorial Photo Gallery Using XML And Flash
Hi I NEED HELP
I have done the tutorial http://www.kirupa.com/developer/mx20...togallery9.htm.

With a little modification for going from the last image to the first with the next button. Everything works with kirupa's images in the xml.
When I put my images in the xml I can't see anything only the loader with Explorer Internet with flash player 6 or 7. It works in firefox, safari or IE with flash 8.
The flash is exported flash 6 and actionscript 2.

the xml is
<?xml version="1.0" encoding="iso-8859-1"?>
<images>
<pic>
<image>http://www.romy-vizzini.be/travaux/illus/4/2.jpg</image>
<caption>INNEOV pictogrammes</caption>
</pic>
<pic>
<image>http://www.kirupa.com/developer/mx2004/pg/kresge.jpg</image>
<caption>INNEOV pictogrammes</caption>
</pic>
</images>

the actionscript is
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("illus_4.xml");
/////////////////////////////////////
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;
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;
}
}
};
function nextImage() {
if (p<=(total - 1)) {
p++;
if (p >= total) {
p = 0 ;
}
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}

}

}
function prevImage() {
if (p>=0) {
p--;
if (p < 0) {
p = total - 1;
}
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}

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

someone can help me????

XML + Flash Photo Gallery Tutorial - Continuous Help
wonder if someone can help im using the xml gallery tutorial: http://www.kirupa.com/developer/mx2004/thumbnails.htm and i was trying to make the thumbnails continuously scroll left and right, instead of stopping when it gets to the end

thanks

XML/Flash Photo Gallery Tutorial Question
Hello,

I'm having some problems with the XML/FLASH Photo Gallery Tutorial (http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm). When I load the swf file into another movie the dynamic text will not display. Any thoughts to why this is happening.

Thank You for any response.

Question Regarding Tutorial 'Photo Gallery Using XML And Flash'
http://www.kirupa.com/developer/mx20...otogallery.htm

I found the above tutorial to be very useful and very easy to follow (which was a blessing for me as I am new to Flash and quite intimidated by it).

I would like to extend this tutorial to achieve another requirement but I am not sure if it is possible.

Please review the following concept and let me know if this is possible:
In the tutorial the images and corresponding text is displayed dynamically based on an XML file. I would like to add a link 'More Info' movie clip to the interface which a user can click to get a page dedicated to that item. In other words, I would like a dynamic URL to be read from the XML and associated with the 'More Info' movie clip. I can get the URL read from the XML and stored into an array but I don't know where or how to pass it so that the 'More Info' clip would contain it as a link.

Any assistance is appreciated

Xml & Flash Photo Gallery Tutorial Question
http://www.kirupa.com/developer/mx20...otogallery.htm

I got it all working and stuff, but i would like it if i could link the image that being displayed.

does anyone know how that could be done?
thanks so much in advance!

Trouble With The Photo Gallery Using XML And Flash Tutorial.
Hello Kirupa forumers,

I am currently having trouble with my photo gallery as it is not loading my images. I have followed the Kirupa tutorial and yes I have edited the Xml file but it's still not loading. Is there a percific format example: .jpg, .gif etc. ?
Please help me on this one.

Thanks.
Dan.

Photo Gallery Using XML And Flash Tutorial Question
I was going through the Kirupa tutorial on this and was wondering if there was a way to change the center location where the image loads. Right now the images load with the top left corner being the point of loading, which would work if I was using just hozizontal images but when loading vertical images, things don't line up. So, my question is there a way to set it to where the loading point is the center of the image, so either vertical and horizontal images load in the same area. Thanks for the help!

Photo Gallery Using XML And Flash Tutorial Question
Hi,
Your tutorial "Photo Gallery Using XML and Flash" is grrreat! Thanks.
I have one question. I would like my photo gallery to auto advance instead of using a button to move to the next photo & caption. How would I change the code to do this? I use MX 2004.
Thanks,
Joy

Flash Photo Gallery Tutorial Needed
Hi, I'm searching for a tutorial for a flash photo gallery. Does anybody here know where to find one?
Checked many sites, but never found one.

Photo Gallery Using XML And Flash Tutorial Question URGENT PLZ
hello everyone
I was reading the Photo Gallery Using XML and Flash tutorial and first of all it is a great tutorial I recommend it to everyone
My question about this tutorial is I want to use the part where the image description shows inside another mc which is loaded externally.I dunno if its possible or not but it looks like its possible...
Need help its really complicated for me

Thanx

LF..

Photo Gallery Tutorial Turned Into Photo Carousel
i've taken the tutorial on this site on how to create an flash photo gallery that loads the content from an xml file. i'd like to alter the output of this fine tutorial and would appreciate any help in doing so.

i would like to create gallery, but instead of only showing one picture at a time, i would like to have a carousel effect where more than one picture is shown at a time, and the buttons control the turn of the carousel. i'm thinking in order to do this i'll need to have the as create a movie clip for each picture (maybe during the for loop). each mc instance would have to have a unique name, and then the buttons could play with the properties of each created mc instance.

here's the code from the tutorial on this. any help would be much appreciated....

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
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;
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;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}

Help With Photo Gallery Tutorial...
Hi. I recently made a photo gallery following this tutorial
http://www.kirupa.com/developer/mx2...hotogallery.htm

I have the gallery in a mc in my flash document. The gallery itself works fine. What I am trying to do is have a page with all thumbnails of the pics and when you press each on, it will make the mc visible with the appropriate picture showing. So far I have make a few pages of thumbnails and I have managed to make it so when you press on each thumnail, the mc with the gallery becomes visible. now, on the mc with the gallery, if I change the value of "p" it will change the picture that is first displayed. So, how can I make the value of "p" change depending on which thumbnail I click? I tried making p = to a variable, then I defined the variable on the first frame of the move, but I can't get the value of that variable to change when I click the thumbnail. If Iset a value for the variable on the first frame when I define it, it works. The gallery will open to the picture number I defined, but I still can't get that value to change when I click on the thumbnails. I tried so many different ways I saw on the internet. I tried with global variables too. I'm completely lost here. Please someone help me out because I'm tearing my hair out over here. Here's the flash file incase anybody wants to look at it.

http://www.mypcmechanics.com/lost/8919.zip

also, when the mc opens with the gallery I can still hear all the buttons being activated that are behind the gallery when I move the mouse over the picture. Is there anyway to stop that?

Hope I made sense and thanks for the help

XML Photo Gallery Tutorial
hi guys,

I need to create a flash photo gallery that loads the photos and photo title with xml but can't seems to b able to find a suitable one.

this is what i need to do http://www.afterlights.com/phuket/photo_gallery.html
basically the photos, thumbnails and photo description will be all controlled by xml
i've created the flash with everything loaded in flash by hard code now, can anyone share any similar tutorial that can do something like this?

million thanks in advance!

Help On The Photo Gallery Tutorial
Hi people. I have tried the photo gallery tutorial and I was successful. Bu the funny thing is out of the 8 pictures i put inside the array, only 6 of them managed to appear. Can anyone offer me any solutions? Thanks

The Photo Gallery Tutorial...
i got a question on this tutorial... its fine the way it is with one picture on it.

what i want to really do is have like 3-4 photos on the stage.. if i click "next" it changes all those 4 photos to the next set..etc..

possible?

thx

Help With Photo Gallery Tutorial
Tutorial Link: http://www.kirupa.com/developer/mx/photogallery.htm

The error I'm getting when I try to play the movie/photo album,
NaN
NaN
(etc. over and over again until I x out. It displays in the output box after I transition from the first picture to either direction.)

I'm not sure what he means by d=direction. Am I supposed to fill a variable in? If so, where do I put that number? I'm grateful for any help.

My alteration of the code:

//Code written by sbeener (suprabeener)
/*
i wrote this code, but you can use and abuse it however you like.
the methods are defined in the order which they occur to make it easier to understand.
*/
// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. "pics/")
// leave it blank if they're in the same directory
this.pathToPics = "http://web.utk.edu/~jwatso13/vacation/";
// fill this array with your pics
this.pArray = ["v2.jpg", "v3.jpg", "v4.jpg", "v5.jpg", "v6.jpg", "v7.jpg"];
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.photo;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
// Actions -----------------------------------------
// these aren't necessary, just an example implementation
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);

Photo Gallery Tutorial
well i completed the tutorial on the photo gallery but when i test it, the image and the buttons are not where i want them to be, if you take a look at the attachment, youll see how it looks. Anybody know whats the problem?

Photo Gallery Tutorial.
i was doing the create a photo gallery tutorial [ http://kirupa.com/developer/mx/photogallery.htm ] and everything works correctly execpt that when i have the gallery load inside of a scrollpane it wont work, it seems like its not getting the right directory or something. any sugestions?

MX Photo Gallery Tutorial
I've been playing with this and I have a question. Is it possible to set it to say loading when it's actually loading the next image, otherwise you just get the white screen and someone may think it's not doing anything?

this is a really good forum.

Tutorial: XML Photo Gallery
Hi dudes,

About that XML Photo Gallery tutorial...

What code do I have to change/add if I have a lot of images in a local folder and not online, and want to preload them all in 1 time. I don't want to preload the images one by one, I want to preload them all in 1.

Thx

Tutorial Photo Gallery
Ok I have read through the tutorial on
Photo Gallery
and this is the only part I do not understand

Code:

this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
I never got how to work that modulo division operator.
That whole section I am confused. I guess because I can't vision how it works. Can someone explain this is detail and simple for stupid people like me.
Thanks in advance

Photo Gallery Tutorial HELP
Hi,

I tried making a photo gallery in flash using the tutorial found on the site. But my pictures are off-centered. Does anyone know what might be the problem? I'm new to flash and can't seem to figure what I'm doing wrong, since i've copied the code from the tutorial.

Please help,

Rye

In Regards To The Photo Gallery Tutorial.
http://www.kirupa.com/developer/mx20..._slideshow.htm

I am very new to flash and action scripting......... so.... how would i make it so that when the user clicks on the image in the slide show....... that image pops up in a larger size

Help:Photo Gallery Tutorial
the code from tutorials works ok for Flash MX but not for Flash 5 , can any one help, im using Flash 5 will soon upgrade to MX.

latin_sydney



/*
i wrote this code, but you can use and abuse it however you like.
the methods are defined in the order which they occur to make it
easier to understand.
*/
// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. "pics/")
// leave it blank if they're in the same directory
this.pathToPics = "animation/";
// fill this array with your pics
this.pArray = ["image0.jpg", "image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg", "image5.jpg", "image6.jpg", "image7.jpg", "image8.jpg", "image9.jpg"];
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.photo;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
// Actions -----------------------------------------
// these aren't necessary, just an example implementation
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);

Photo Gallery Tutorial A Lil Help
Hey all I just finished reading through the two gallery tutorials on this site the first here http://www.kirupa.com/developer/mx20...otogallery.htm and the second to add thumnails to the gallery found here http://www.kirupa.com/developer/mx2004/thumbnails.htm.

I just had two questions on how to modify the gallery. The first question is in the begining of the add thumbnails tutorial its shows and option to display the thumbnails in a grid. I was wondering how would I go about making that grid totally lost any help to achieve this would be great. Is it possible to get the thumnails to be listed in the list box component.

My second question is I know how the description text of each image is called. But I wanted to create a pop up buble graphic that if you rolled over and information icon it would display the pop up graphic with description to the corresponding image.

Last quick question how do i change the width and height of the thumbnail images inside the scroller.

Thanx for any help

Xml Photo Gallery Tutorial
hi, i used the xml photo/thumb tutorial with some modifications and it seems to only be working when viewed in firefox, not with IE. in addition, it doesnt preview properly in flash. everything seems to be in order, but any ideas as to what may be happening?

forgot the code:

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("gallery.xml");
/////////////////////////////////////
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;
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;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 20;
tscroller.onEnterFrame = function() {
if ((this._ymouse>=thumbnail_mc._y) && (this._ymouse<=thumbnail_mc._y+thumbnail_mc._heigh t)) {
if ((this._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((this._xmouse<=(hit_left._x+40)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}


and the gallery.xml code is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<images>
<pic>
<image>photos/photo-01.jpg</image>
<thumbnail>thumbs/photo-01.jpg</thumbnail>
</pic>
[etc. with pic array]
</images>

About The Photo Gallery Tutorial......
Instead of the jpg file, can the photo gallery load gif or bmp files?

Help With The Photo Gallery Tutorial Please..
hello.

I'm sorry if this has been answered in a previous thread, I searched but found nothing.

I am working with the Flash MX photo gallery that is posted in the tutorial section, and I seemed to have run into a snag.

I replaced the images (image0 - image9) with my own images that I want to use with the slideshow, and those images don't get recognized. I tried naming them the same and naming them differently and changing the code to reflect that, but they still do not come up in the slideshow.

Am I doing something wrong here. I am at wits end as to what else to try. any help is appreciated.

XML Photo Gallery Tutorial
Hi,

Hope someone can help, when I try to open the fla on this thread > http://www.kirupa.com/developer/mx20...otogallery.htm

it comes up with 'Failed to open'. Can anyone shed any light on this? This would be a REALLY handy tutorial as it is exactly what I need to accomplish for a project I am about to start!

Thanks in advance

PS - I 'am' opening the correct verion (flash 2004)

Help With Photo Gallery Tutorial
Ok, I figured it out! Thanks.

Photo Gallery Tutorial
Hi,everybody. I was wondering if i could get some help or guided in the right direction in finding my answer. I did this photo gallery tutorial (http://www.kirupa.com/developer/mx/photogallery.htm). I magment get everything to work but when i put the script in a moveClip that goes on my main time line, it doesn't work. ideally i would like to put the script in a swf that will load in to may main movie. If somebody could help that would be grate.

This is what the script looks like.

// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. "pics/")
// leave it blank if they're in the same directory

this.pathToPics = "animation/";

// fill this array with your pics

this.pArray = ["image0.jpg", "image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg", "image5.jpg", "image6.jpg", "image7.jpg", "image8.jpg", "image9.jpg", "image10.jpg","image11.jpg", "image12.jpg","image13.jpg","image14.jpg","image15 .jpg","image16.jpg","image17.jpg","image18.jpg","i mage19.jpg","image20.jpg"
];
this.fadeSpeed = 20;
this.pIndex = 0;


// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation

loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.photo;


//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};


// Actions -----------------------------------------
// these aren't necessary, just an example implementation


this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);

Photo Gallery Tutorial Help
Hi all,

I have used the Photo Gallery (with scrolling thumbnails) tutorial on kirupa.com as the basis for a project I am working on for my client. Basically, they have 8 different categories of products they want to show images of, so I set up 8 different xml and swf files that are loaded into a level from a main swf that holds the nav buttons.

My question: Is there a way to add some script that when you reach the end of one category, that it will then load the next category on the final "next" button hit? In other words, there are 5 images to load in category 1, you click through that category and when you come to the last image, you click next again and it will then load category 2 swf?

Thanks in advance

Copyright © 2005-08 www.BigResource.com, All rights reserved