> hi nicolas,
> 
> how hard would it be to create a scope method for functions? the method 
> would take whatever you give it and put that function in to that scope. 
> for example,
> 
> class x {
>     function setFocusHandler() {
>         // label.owner = this;
>         // set scope using the scope function part of Function class
>         label.onKillFocus.scope(this)
>         label.onKillFocus = function() {
>             trace("this="+this) // scope is class x
>         }
>     }
> }
> 

Not this way because it's not typable, but you'll be able to do the 
following in haXe :

label.onKillFocus = button.onClick;

(*only* if onClick is declared as a function)

This is like method closures in AS3, but it will work also for 
Player6-7-8 :)

Nicolas

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to