Its legal according to congress, but then again what are they doing right these day lol.
This is my cMovie class I am doing the same thing in the class that that snipit came from, so Im not quit sure why it's not working. The only thing that I could think of would be that the array is not taking a reference so once scope ends the real cMovie gets garbage collected. But that can't be the case from what you say.Code:package ActionScript { //======================================= // cMovie // // Purpose: Hold our movie info //======================================= import flash.net.URLLoader; import flash.net.URLRequest; import ActionScript.cMovie; import flash.events.*; public class cMovie { // Member vars private var m_sFile:String; private var m_aImages:Array; private var m_nSize:Number; private var m_bLoaded:Boolean; //======================================= // LoadImages // // In: e - The data we need. // // Purpose: Simple Constructor. //======================================= private function LoadImages(e:Event):void { var xml:XML = new XML(e.target.data); m_nSize = xml.Images.length(); for(var i = 0; i < m_nSize; i++) m_aImages.push(xml.Images.Image[i]); m_bLoaded = true; } //======================================= // Constructor // // In: sFile - The file to load. // // Purpose: Simple Constructor. //======================================= public function cMovie(sFile:String = "") { m_bLoaded = false; m_sFile = sFile; Load(); } //======================================= // Load // // Purpose: Loads our images. //======================================= public function Load():void { var xmlLoader:URLLoader = new URLLoader(); xmlLoader.addEventListener(Event.COMPLETE, LoadImages); xmlLoader.load(new URLRequest(m_sFile)); } //======================================= // Accessors/Mutators // // Purpose: Get and set our vars. //======================================= public function GetFile():String { return m_sFile; } public function GetImage(nIndex:Number = 0):String { return m_aImages[nIndex]; } } }
Also there may be some stuff wrong in the latter but I'm not worried about that as of yet just trying to get past this crash point lol.




Reply With Quote