Return to Snippet

Revision: 33036
at October 5, 2010 13:15 by heathbo


Initial Code
var Loader:URLLoader = new URLLoader();
var xmlData:XML = new XML();

Loader.load(new URLRequest("xml/start.xml")); 
Loader.addEventListener(Event.COMPLETE, LoadXML1); 

function LoadXML1(e:Event)
{
	xmlData = new XML(e.target.data);		
};

function steveClick(evt:MouseEvent):void  // Mouse click to get xml info
{
	loadText("Steven Williams");
};

function loadText(textLoad)
{
	var testimonialList:XMLList = xmlData.question.(@Title == textLoad).description; 
	TestimonialsMain_mc.txtText.text = testimonialList;
};

Initial URL

                                

Initial Description
///////////////////////////////////////////////////////////////////////////////////////////
XML USED IN EXAMPLE:

<question>
<description>
This is the copy that goes in the description text
</description> 
</question>

Initial Title
Import an XML file and use the data.

Initial Tags

                                

Initial Language
ActionScript 3