On 11/21/05, Judah Frangipane <[EMAIL PROTECTED]> wrote:
> So with your method I can do this:
>
> Function.prototype.setScopeTo = function(object) {
>  var __method = this;
>  return function() {
>    __method.apply(object, arguments);
>  }
> }
>
>
> class x {
>     function setFocusHandler() {
>         var func = function() {
>             trace("this="+this) // scope is class x
>         }

This won't work, it doesn't modify the function in place, it returns a
new function.
>        // label.onKillFocus = func;
>        // label.onKillFocus.setScopeTo(this);

Do this instead:
           label.onKillFocus = func.setScopeTo(this);

>     }
> }
>
>
>


-David R

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

Reply via email to