Since it doesn't allow me to edit my own post here's an update:
Here's what I have so far, this is from a tutorial:
The AS is attached to a keyframe, not in its separate class.Code:import com.greensock.*; import flash.events.Event; import flash.events.MouseEvent; import flash.events.KeyboardEvent; import flash.display.MovieClip; import flash.media.Sound; import flash.media.SoundChannel; import flash.utils.ByteArray; var imageArray:Array = new Array(); var painterArray:Array = new Array(); var titleArray:Array = new Array(); var dateArray:Array = new Array(); //Loader event for the XML var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, onLoaded); var xml:XML; loader.load(new URLRequest("mday.xml")); function onLoaded(e:Event):void { //load XML xml=new XML(e.target.data); var il:XMLList=xml.images; listLength=il.length(); //fill up the array from XML populateArray(); } function populateArray():void { //takes the properties defined in the XML and stores them into arrays var i:Number; for (i = 0; i < listLength; i++) { imageArray[i]=xml.images[i].pic; titleArray[i]=xml.images[i].title; painterArray[i]=xml.images[i].painter; dateArray[i]=xml.images[i].date; } }
Thanks.




Reply With Quote