Paranoid the reason nothing is coming out is that nothing is coming in? This is a nice and easy alert option to print out your XML doc as an alert, so you know the data's there. If nothing's working - it's some other reason! $.ajax({ type: "GET", url: "courses.xml", dataType: "xml", success: function (data) {... Continue Reading →
DataGrid data to XML AS3
Probably not the prettiest method to do this, but it'll do for just before I go home. This is to change datagrid objects back into XML - this is only for my case and needs custom coding, but the method is there! var newXML:XML = new XML(<coaches></coaches>); for (var i:int = 0; i < dataGrid.length;... Continue Reading →
Retrieving attributes from XML in AS3
To return specific attributes of an xml node, you can use the @[attribute] reference - pretty handy. Eg, with this xml: <question file="test_file.swf"> You can call that file attribute using the below: myXMLList.question[0].@file; // returns test_file.swf
HTML Characters in XML
I've been doing some work with XML in AS3 and needing to have the XML contain HTML characters for an htmltext field in Flash - for links and lists etc. Few ways to approach that: <![CDATA[ "Rampant <'s and &'s in the XML fields that XML ignores due to special CDATA tags within the fields"... Continue Reading →
Loading XML into flash as an XML object
loading XML into flash as an XML object // xml loader var xmlLoader:URLLoader = new URLLoader(); var xmlData:XML = new XML(); xmlLoader.addEventListener(Event.COMPLETE, loadXML); xmlLoader.load(new URLRequest("leadership_development_framework.xml")); function loadXML(event:Event):void { xmlData = new XML(event.target.data); } Further to that, once you've your xmlData filled, you can chop it up with XMLList to make sub-listings for easier management. For... Continue Reading →