Hello :) Your code is cut ??? where is the declaration of the xml etc ?
You can try to use mx.utils.Delegate to create a proxy between the onLoad event of the reference and a method in your class with the scope of the current instance : import mx.utils.Delegate ; class Loader { /** * Creates a new Loader. */ function Loader() { super() ; lv = new LoadVars() ; x = new XML() ; x.onLoad = Delegate.create(this, _test) ; } /** * The LoadVars reference of this loader. */ public var lv:LoadVars ; /** * The XML reference of this loader. */ public var x:XML ; /** * Trigger the loader. */ public function trigger( url ):Void { lv.sendAndLoad( url , x ) ; } /** * Returns the string representation of the object. */ public function toString():String { return "[Loader]" ; } /** * Internal method to test the result */ private function _test( success:Boolean ) { trace("> " + this + " test : " + success); trace("> " + this + " xml : " + x ) ; // continue your test here ! } } EKA+ :) 2006/12/6, Fratiman Vladut <[EMAIL PROTECTED]>:
Hi! I have this class: class LoadVars2 extends LoadVars { function LoadVars2() { super(); } function populate(){ ............................... my_xml.onLoad = function(){ //code for test } } private function test(){ trace("ok"); } } If i try to access test function before my_xml.onLoad, all works, but when i try to access into onLoad function body (after "code for test" comment), fail. How i can resolve that ? _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
_______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com