To learn more about Delegate I'd suggest you read the following : http://osflash.org/flashcoders/as2
Alain -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rákos Attila Sent: 4 juin 2007 10:32 To: Daniel Glue Subject: Re: [Flashcoders] Setting up loadVars onLoad handler within custom class Where did you instantiate LoadVars? I don't see it anywhere. But it almost doesn't matter, since you will have scoping problems, look after some kind of delegation (eg. mx.utils.Delegate). Attila DG> Hey there, I am creating a custom class with a loadVars object that DG> gets data from a web page. My problem is I can't get my loadVars DG> object to load! I think I am setting the onLoad handler in the wrong DG> place. Might anyone have any ideas how I set this inside my custom DG> class? DG> DG> Thanks in advance guys! DG> Danny DG> DG> DG> Here is my code: DG> DG> Class VersionChecker{ DG> private var my_lv:LoadVars; DG> private var xmlAdd:String; DG> private var browserType:String; DG> private var ipAddress:String; DG> DG> DG> //receives url to connect to sets onLoad handler DG> public function VersionCheck(xmlAddy:String { DG> xmlAdd = xmlAddy; DG> my_lv.onLoad = function(success:Boolean) { DG> if (success) { DG> trace("loaded"); DG> browserType = this.browser; DG> ipAddress = this.ip; DG> } else { DG> trace("load failed"); DG> } DG> }; DG> startCheck(); DG> } DG> DG> private function startCheck() { DG> trace("version checker starting to check:"+xmlAdd); DG> my_lv.load(xmlAdd); DG> } DG> } _______________________________________________ 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 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.472 / Virus Database: 269.8.7/830 - Release Date: 2007-06-03 12:47 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.472 / Virus Database: 269.8.7/830 - Release Date: 2007-06-03 12:47 _______________________________________________ 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