Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 07-20-2008, 06:29 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
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);

__________________
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.