Delegate!

import mx.utils.Delegate;
// ...
public function grabHTML():Void {
   var html_data:LoadVars = new LoadVars();
   html_data.onData = Delegate.create(this, doSomething);
   html_data.load("http://somesite.ca/some.html";);
}


On 2/14/07, Andrew Murphy <[EMAIL PROTECTED]> wrote:
I'm programming a class which includes something like following methods:







// grab some .html

public function grabHTML():Void {

            // loads the .html

            var html_data:LoadVars = new LoadVars();

            // once the .html is loaded…

            html_data.onData = function():Void {

                        // …run "doSomething()"

                        doSomething();

            };

            html_data.load("http://somesite.ca/some.html";);

};



// does something after the .html has been loaded

public function doSomething():Void {

            trace("doing something");

};











Unfortunately the second function "doSomething" never happens.  Can anyone
clue me in as to what I'm doing wrong..?



Thank you. :)



-[a]-




--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.17.39/686 - Release Date: 14/02/2007
7:54 AM

_______________________________________________
[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



--
T. Michael Keesey
Director of Technology
Exopolis, Inc.
2894 Rowena Avenue Ste. B
Los Angeles, California 90039
--
The Dinosauricon: http://dino.lm.com
Parry & Carney: http://parryandcarney.com
ISPN Forum: http://www.phylonames.org/forum/
_______________________________________________
[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

Reply via email to