That's what catchevent() is for.
objectA.catchevent(
objectBName,
eventNameToCatch,
newEventName);
PHP Code:
function blah() {
new GuiButtonCtrl("SpecialButton" @ number) {
//stuff
thiso.catchevent(this.name, "Action", "ButtonAction");
}
}
function onButtonAction(objectname) {
echo("Button Action from " @ objectname);
}
The new event will always have the name of the object you're catching from as the first parameter.
The following script does the exact same as the above.
PHP Code:
function blah() {
new GuiButtonCtrl("SpecialButton" @ number) {
//stuff
}
this.catchevent("SpecialButton" @ number, "Action", "ButtonAction");
}
function onButtonAction(objectname) {
echo("Button Action from " @ objectname);
}