Incidentally, in AS3 all functions preserve their scope, so Delegate
is no longer needed. (Yay!) But, in the meantime, Delegate is the best
solution to the problem of associating a function call with a scope.

Also worth mentioning is that since static functions have no scope,
you don't need to use Delegate with them.

class MyClass {
   public function MyClass() {
       var nameData:LoadVars = new LoadVars();
       nameData.onData = sayHelloTo;
       nameData.load("filename.txt");
   }
   public static function sayHelloTo(name:String):Void {
       trace("Hello, " + name + "!");
   }
}

On 2/15/07, Andy Herrman <[EMAIL PROTECTED]> wrote:

[explanation snipped]

On 2/15/07, Omar Fouad <[EMAIL PROTECTED]> wrote:
> mmm still don't get the delegate concept....
_______________________________________________
[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