My problem is I can’t get the image and dynamic text (using typewriter effect) to work simultaneously. I can get either one to work but not both. My fla file explains it better than I can. The below code to get the text node from the XML file appears within the preload image function. If the line in red ([COLOR=Red]TextEffect(location);[/COLOR]) is commented out, the image loads. If the line is left in, the text loads.
I hope someone can help, Thank you.
//Load XML data
ImageLocation = new XML();
ImageLocation.ignoreWhite = true;
timeline = this;
// Function to load text when xml is done loading:
ImageLocation.onLoad = function(){
portfolioTag = this.firstChild;
//LocationNode is set to zero the first text node is called
location = portfolioTag.childNodes[LocationNode].attributes.LOCATION;
[COLOR=Red]**TextEffect(location);**[/COLOR]
}
ImageLocation.load("location.xml");
This function is called to acheive the text effect:
function TextEffect(location){
myText="";
this.onEnterFrame = function() {
description.text = myText.substr(0, type);
type += 3;
myText = location;
};
type = 0;
}
Xml File (location.xml)
<?xml version="1.0" encoding="ISO-8859-1"?><random>
<file title="chicago" location="the sears tower, chicago" image="images/c9.jpg"/>
<file title="bangkok" location="victory monument, bangkok" image="images/b20.jpg"/>
</random>