A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: Ive had this before damn memory onLoad issue

  1. #1
    Senior Member
    Join Date
    Aug 2004
    Location
    London
    Posts
    211

    Ive had this before damn memory onLoad issue doesnt like being in class

    the following works outside of a class but I cant get the onLoad to fire another function inside the following class construct.

    Code:
    class Screen  {
    	private var code:String;
    	private var type:String;
    	private var theme:String;
    	private var title:String;
    	private var xmlFile:String;
    	private var dataXML:XML;
    	//--------------------------------------------------------------
    	public function Screen(code) {
    		this.code = code;
    		//trace("extended with CurrentPage");
    		//trace("need to load the particular xml file here "+code+".xml");
    		this.loadXML();
    	}
    	private function loadXML() {
    		
    		dataXML = new XML();
    		dataXML.load("content/xml/"+this.code+".xml");
    		dataXML.onLoad = function() {
    			trace("loaded xml");
    
    			this.toVars("test");
    			// the XML is loaded so strip out the whitespace
    			dataXML.ignoreWhite = true;
    			// turn the XML doc content into flash variables
    			
    		};
    	}/**/
    	
    	private function toVars(a){
    		trace(">>"+a);
    		//parse through the document and put our page into manageable object or arrays ?
    		//how best to do this?
    		//this is the parent class so is dealing only with screen based content.		
    		}
    }
    toVars will not fire, despite the onLoad firing as it traces ok. I give the xml here
    Code:
    <menuroot>
        <node item="code" value="000000" />
        <node label="type" pos="contentTitle" />
    	<node label="theme" pos="turqoiseBay" />
    	<node label="content">
    			<node item="title" value="<![CDATA[DISK OVERVIEW]]>" />
    			<node label="graphic" pos="00000000.swf" />
    	</node>
    </menuroot>
    Last edited by mojito; 12-12-2006 at 08:40 AM. Reason: more info
    ----------------------------
    A travel blog

    Landed At
    ----------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center