Quote:
Originally Posted by Inverness
Here is an alternative.
PHP Code:
function onActionGrab() {
this.level.chair.trigger("ActionShock", "");
}
PHP Code:
function onCreated() {
this.setshape(1, 32, 32);
this.level.chair = this;
}
function onActionShock() {
// do stuff
}
The this. prefix isn't required in this instance but it is my preference to do it like that so you clearly know what the variable belongs to.
|
I like this idea, I didn't think of this! [However, you'd need to remove the 'this.level.chair' to replace it with 'level.chat' and also make the 'onActionShock' a public function]