Imagine I have Class A that is listening to an Event on Class B. This listener will call Method X in the Class A. Inside Method X, "this" refers to the Instance of Class B, I'm not in the context of Class A. Isn't this a bit awkward, or am I getting everything wrong? Is there a way to make the listener call my method in the context of A?
Thanks a lot for your attention, hope someone can clear my mind about this
you can use the Delegate class to maintain scope. use google to check for usage of Delegate.create
Yes, you are right, thank you very much, you helped me a lot!
In case someone has the same problem I'm now calling:
softKeys.addEventListener("rightSoftKeyClicked", Delegate.create(this, RightSoftKeyClicked), false, 0, false);
softKeys.addEventListener("rightSoftKeyClicked", RightSoftKeyClicked, false, 0, false);
(By the way, these are not real soft-keys, they're just graphics I created for touch screen devices)