-
AS2 - Need help with importing text from XML
I can't seem to figure out why only one out of the five text fields show when I export my fla. The title and images work fine but none of the other descriptors are not working. What am I doing wrong? I checked my instance names and they all match. I've tried using .text and .HTMLText in the AS and nothing. Any help would be greatly appreciated.
AS2
import mx.transitions.Tween;
import mx.transitions.easing.*;
var galleryTitle:String;
var totalImages:Number;
var autoSS:Number;
var CSI:Number; // Current Showed Image
var NItL:Number = 0; // Next Image to Load
var MCLs:Array = new Array();
var targets:Array = new Array();
var imgLoaded:Array = new Array();
var imgPaths:Array = new Array();
var loadList:Object = new Object();
var navList:Object = new Object();
var sleep:Boolean = true;
var onFocus:Boolean = false;
var imagesXML:XML = new XML();
imagesXML.ignoreWhite = true;
var XMLLoaded:Boolean = false;
var initCall:Boolean = false;
//var border:MovieClip;
var navigation:MovieClip;
/* ---------------------------------------------------------------------- */
imagesXML.load("./gallery.xml");
onEnterFrame = function () {
if (XMLLoaded) {
if (!initCall) {
initCall = true;
//border = this.attachMovie("border", "borderMovie", totalImages+2);
//border._x = 0;
//border._y = 238.2; // 300
navigation = this.attachMovie("nav", "navMovie", totalImages+1);
navigation._x = 0;
navigation._y = 446.6; // 300
for (i=0; i<totalImages; i++) {
MCLs[i] = new MovieClipLoader();
MCLs[i].addListener(loadList);
imgLoaded[i] = 0;
var newTarget = this.attachMovie("target", "target" + String(i), totalImages-1-i);
targets[i] = newTarget;
targets[i]._alpha = 0;
targets[i]._x = 25.5;
targets[i]._y = 1.40;
}
loadImage(0);
navigation.changeImgShow();
}
if (imgLoaded[0]) {
var showTw:Tween = new Tween(targets[0], "_alpha", none, 0, 100, 20, false);
CSI = 0;
loading.SHLoading("hide");
delete this.onEnterFrame;
}
}
}
imagesXML.onLoad = function () {
images = this.firstChild.childNodes;
for(var i=0; i<images.length; i++) {
imgPaths.push(images[i].attributes.path);
}
totalImages = imgPaths.length;
autoSS = this.firstChild.attributes.slideshow == "true" ? 1 : 0;
intervalSS = parseInt(this.firstChild.attributes.interval)*1000 ;
galleryTitle = this.firstChild.attributes.title;
client_txt.text = this.childNodes.attributes.client;
description_txt.text = this.childNodes.attributes.description;
state_txt.text = this.childNodes.attributes.state;
XMLLoaded = true;
}
My XML:
<?xml version="1.0" encoding="iso-8859-1"?>
<gallery title="Atriums" slideshow="false" interval="5">
<image path="atrium/atrium1.jpg" client="name" description="Interior" state="Phoenix, Arizona"/>
<image path="atrium/atrium2.jpg" client="name" description="Interior" state="Phoenix, Arizona"/>
<image path="atrium/atrium3.jpg" client="name" description="Interior" state="Phoenix, Arizona"/>
<image path="atrium/atrium4.jpg" client="name" description="Interior" state="Phoenix, Arizona"/>
<image path="atrium/atrium5.jpg" client="name" description="Interior" state="Phoenix, Arizona"/>
<image path="atrium/atrium6.jpg" client="name" description="Interior" state="Phoenix, Arizona"/>
<image path="atrium/atrium7.jpg" client="name" description="Interior" state="Phoenix, Arizona"/>
</gallery>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|