Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml and flash

Status
Not open for further replies.

richardko

Programmer
Jun 20, 2006
127
US
Hi,
I have never done any extensive looking into flash and I was hoping someone would guide me to a tutorial where I can create a flash animation like this site(at the top of the page):

Would it be possible to use xml data to make the content dynamic?
Thanks
ro
 
Thanks for the reply.
I am not sure how the global variables function but my test to create an array fails. Any idea how to edit so that the "arr" is not empty. The xml file is after the code

Code:
_global.arr = new Array();
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("xml.xml");
trace(_global.arr);

function loadXML(loaded) {

if (loaded) {	
var person:Array = xmlData.firstChild.childNodes;
for (var i:Number = 0; i < person.length; i++) {
	var node:XMLNode = person[i];
	//arr.push(node.childNodes[2].firstChild.nodeValue);	
	_global.arr[i] = node.childNodes[2].firstChild.nodeValue;		
}
} else {
  trace("file not loaded!");
}
}
The xml file is here:
Code:
<?xml version="1.0"?>

<inventors>
	<person>
		<name>Thomas Edison</name>
		<comment>Inventor of many things such as the incandescent lightbulb.</comment>
		<picture>picture2.jpg</picture>
	</person>
	<person>
		<name>Doug Engelbart</name>
		<comment>Invented the mouse at the Stanford Research Institute</comment>
		<picture>picture3.jpg</picture>	
	</person>
</inventors>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top