I came accross this problem in someone else's post today. They could use a workaround. I cannot. Checkout the following code )simplified example):
I have a button on the stage with instance name 'tmp'.Code:Object.prototype.setButton = function() { trace(this.name); tmp.onPress = function() { trace(this.name); }; }; myAr = {name:"John"}; myAr.setButton();
I need some help figuring out how to make the onPress function spit out the name property of the Object which created the handler. At present the 'this.name' in the handler ends up referring to the MovieClip, not the object! I understand why, but I dont understand how to make it do what I want. I'm not too good at al this in depth OO stuff. Any help?