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> }
_______________________________________________
[email protected]
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