Problem assigning a tween
I have a gallery where passing over the image a rectangle drops down showing the caption for the image.
The informations are read from an XML file and some of my images don't have a caption, for those emails I want to avoid the tween.
The XML file has this structure:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>gallery/certificato.jpg</image>
<thumbnail>gallery/certificato_s.jpg</thumbnail>
<caption>none</caption>
<desc>none</desc>
</pic>
</images>
The code where the tween are associated to the images is this
function initGallery()
{
function loadXML(loaded)
{
if (loaded)
{
xmlNode = this.firstChild;
total = xmlNode.childNodes.length;
for (i = 0; i < total; i++)
{
_root.small_image = xmlNode.childNodes.childNodes[1].firstChild.nodeValue;
_root.big_image = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
_root.description = xmlNode.childNodes.childNodes[2].firstChild.nodeValue
_root.testo = xmlNode.childNodes.childNodes[3].firstChild.nodeValue;
if (i == 0)
{
/* added the last parameter accordingly to the modified loadGImage */
_root.loadGImage(_root.description, _root.big_image, _root.testo, i);
} // end if
if(_root.testo != "none") { //shadowbox tween in
_root.bigImage.onRollOver = function() {
var shadowboxIn:Tween = new Tween (shadowbox_mc, "_y", Strong.easeOut, -49, 0, .5, true);
}
}
if(_root.testo != "none") { //shadowbox tween out
_root.bigImage.onRollOut = function() {
var shadowboxOut:Tween = new Tween (shadowbox_mc, "_y", Strong.easeOut, shadowbox_mc._y, -49, .5, true);
}
}
++_root.total_images;
} // end of for
createSmall();
}
else
{
content = "file not loaded!";
} // end else if
} // End of the function
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
if (_root.xml_file == undefined)
{
_root.xml_file = "images.xml";
} // end if
xmlData.load(xml_file);
} // End of the function
I try to avoid the tween checking whether the caption value is "none" or not, but that doesn't work, the tween is always applied.
How can I do?