all groups > flash (macromedia) > october 2007 >
You're in the

flash (macromedia)

group:

trying to get " url " to work in my scroller/ gallery...


trying to get " url " to work in my scroller/ gallery... treybraid1968
10/14/2007 9:27:01 PM
flash (macromedia): trying to get " url " to work in my scroller/ gallery...


--------------------------------------------------------------------------------

please take a look at my action script and xml... ive got all the fields
working except for the " url " ... what adjustments do i need to make to get
the url for each pix to work...

thanks...trey

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


and here is my xml...


<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>sample1.jpg</image>
<title>Google</title>
<headline>headline 1</headline>
<description>this is the description of article 1.</description>
<link>http://www.google.com</link>
<targetIsUrl>Y</targetIsUrl>
</pic>
<pic>
<image>sample2.jpg</image>
<caption>Yahoo</caption>
<headline>headline 2</headline>
<description>this is the description of article 2.</description>
<link>http://www.yahoo.com</link>
<targetIsUrl>Y</targetIsUrl>
</pic>
<pic>
<image>sample3.jpg</image>
<caption>BAS-llc</caption>
<headline>headline 3</headline>
<description>this is the description of article 3.</description>
<link>http://www.bas-llc.com</link>
<targetIsUrl>Y</targetIsUrl>
</pic>
<pic>
<image>sample4.jpg</image>
<caption>USC Trojans</caption>
<headline>headline 4</headline>
<description>this is the description of article 4.</description>
<link>http://www.uscripsit.com</link>
<targetIsUrl>Y</targetIsUrl>
</pic>
</images>
Re: trying to get " url " to work in my scroller/ gallery... cornelius
10/15/2007 10:39:38 AM
It is not clear where you use it?

Can you show the fla?
AddThis Social Bookmark Button