Hi, I am new to both Flash and Kirupa. As an introduction to flash I decided to complete the thumbnail slideshow tutorial and all is good. I am now trying to have an XML node displau as a hyperlinkon the slide show.
I have searched these forums and tried all solution but with no luck. I keep receiving “NULL” as my link. Here is an example of the XML code;
[COLOR=Blue]<?xml version=“1.0” encoding=“utf-8” standalone=“yes”?>
<images>
<pic>
<image>\portfolio_images\abs_accred_lge.jpg</image>
<caption>ABS</caption>
<thumbnail>\portfolio_thumbs\abs_accred_thumb.jpg</thumbnail>
<details>Details go here.</details>
<features1>Feature 1</features1>
<features2>Feature 2</features2>
<features3>Feature 3</features3>
<link><a href=‘http://www.google.com’>Click here</a></link>
</pic>
[/COLOR][COLOR=Blue]</images>
[COLOR=Black]
and here is the Flash Action Script;
[COLOR=Blue]function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
details = [];
features_1 = []; features_2 = []; features_3 = [];
link = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
thumbnails* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
details* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
features_1* = xmlNode.childNodes*.childNodes[4].firstChild.nodeValue;
features_2* = xmlNode.childNodes*.childNodes[5].firstChild.nodeValue;
features_3* = xmlNode.childNodes*.childNodes[6].firstChild.nodeValue;
link* = xmlNode.childNodes*.childNodes[7].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“images.xml”);
/////////////////////////////////////
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];
desc_1.text = details[p];
feature_1.text = features_1[p];
feature_2.text = features_2[p];
feature_3.text = features_3[p];
visit_link.text = link[p];
myText.html = true;
myText.selectable = false;
myText.htmlText = link[p];
}
}
}
function prevImage() {
if (p>0) {
p–;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
desc_1.text = details[p];
feature_1.text = features_1[p];
feature_2.text = features_2[p];
feature_3.text = features_3[p];
visit_link.text = link[p];
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
desc_1.text = details[0];
feature_1.text = features_1[0];
feature_2.text = features_2[0];
feature_3.text = features_3[0];
visit_link.text = link[0];
}
}
rowLength = 50;
rowValue = 0;
colLength = 50;
colValue = 0;
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc)
{
col = colLength * colValue;
target_mc._x = col;
target_mc._y = row;
colValue++
if (colValue == 4){
colValue = 0;
rowValue++
row = rowLength * rowValue;
}
target_mc.pictureValue = k;
target_mc.onRelease = function()
{
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function()
{
this._alpha = 50;
this._xscale = 100;
};
target_mc.onRollOut = function()
{
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
[/COLOR]
As you can see I have tried to work with the test variable [/COLOR][/COLOR][COLOR=Blue][COLOR=Black][COLOR=Blue]myText [COLOR=Black]but with no luck.
I have also tried using CDATA in the XML but still to no avail.
If anyone can point me in the right direction then it will be greatly appreciated.
[/COLOR][/COLOR][/COLOR][/COLOR]