Variable from xml file

Here’s what I’m trying to get going:
I have a photo gallery for a painter rotating through images via XML. She wants a little sold sign to appear on ones that have been sold. I’d like to figure out a way to make it appear/disappear with a _visible = true/false statement that I can call from via the XML file.

Something like:
<node>
<img>“img.jpg”</img>
<sold>true</sold>
</node>
<node>
<img>“img2.jpg”</img>
<sold>false</sold>
</node>

Is this possible? I know that may not be a correct syntax, I can’t get it to work. Any Ideas? Thanks.

Can you post/ send me your actionscript for his - rcianciaruso@comcast.net ? I am trying to do the photogallery which rotates thru images… and having a hard time. Regarding your question, can’t you just create an additional field in your XML file called status… and put SOLD or AVAILABLE in there… and display it ?

Hey, Igby,

The easiest way would be to cast the value of your sold node as a string, then check its value in Flash. Something like:

xml:

 
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<!-- test.xml (booleans in xml) -->
<paintings>
 <node>
  <img>img.jpg</img>
  <sold>true</sold>
 </node>
 <node>
  <img>img2.jpg</img>
  <sold>false</sold>
 </node>
</paintings>

and AS:
[AS]var xml:XML = new XML();
xml.ignoreWhite = true;
//
xml.onLoad = function(success) {
if (success) {
initDisplay(this.firstChild.childNodes);
}
};
//
function initDisplay(paintings:Array):Void {
var len:Number = paintings.length;
for (var i = 0; i < len; i++) {
trace(“Load: " + (paintings*.childNodes[0].firstChild.toString()));
var sold:String = paintings*.childNodes[1].firstChild.toString();
if (sold == “true”) {
trace(“make ‘sold’ movie clip visible”);
} else {
trace(“leave ‘sold’ movie clip be.”);
}
trace(”

");
}
}
//
xml.load(“test.xml”);[/AS]

Thank you devonair, that was just what I needed.