View Full Version : Can an object's "this" property be reassigned?
10-22-2009, 02:52 PM
I have an object that passes itself to an inherited static function using the "this" property, but by the time the function is called "this" becomes a global variable.
Can anyone shed some light on way this happens?
10-22-2009, 03:20 PM
I don't understand what you mean by '"this" becomes a global variable' ?
If you mean that by the time you call this static function and pass this to it the this does not point to what you expect then it's just a code logic problem not a weird bug from Flash. "this" just points to the current object in scope and no this cannot be reassigned only the "this" changes when the scope changes.
10-22-2009, 07:29 PM
Technically, the Function class allows you to set the value of "this" prior to invocation, but it's a stupid thing to do.
vBulletin® v3.8.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.