Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>Creating Handlers

Creating Handlers

Nemesis02
02-03-2005, 10:20 PM
Hi, I need some help creating part of a JScript, it's a bot for a MUD i play called Nodeka. Well, the client i'm programming it for has a handler:

jmc.registerhandler("Input","function()");


Then a variable jmc.event which contains the input is passed to the function()

Well, i need a way to branch out that handler to other functions dynamically for when loading scripts. Like if i load another JScript, have the function that is the input function be stored to a variable, then the function() call on that function/variable to run the code that the script loaded.

registerhandler can only handle 1 function, which just isnt acceptable =) i need to make it expandable.

I was thinking something on the line of the new script

function inputfunction( event ) {
blah blah blah
}

handler.push( "inputfunction" );

then the actuall script will run through the handler array running all the functions in it.

Could use any assistance, here's an example of what i'm talking about.

core:
var handler = new Array();
function input() {
for (var x = 0; x < handler.length; x++) {
handler[ x ]( jmc.event );
}
}
jmc.registerhandler("Input","input()");


file to load:
function scriptinput( event ) {
blah blah blah...
}

handler.push( "scriptinput" );


Thanks.

Willy Duitt
02-06-2005, 04:57 PM
I've just pulled this up from back on page three... I would imagine that your question has remained unresponded too because there is too much blah blah blah and not enough specifics...


.....Willy


 

TOP

For more info

setting a minimum size
Auto Preview of Image 
Refresh with a query s
JS Validation obsolete
Javascript Pop up func
Slide show transitions
I'm a newbie...please!
how to write coding in
Advanced Debug Info 
.js file doesn't work 

News Archive

Adding Graphic To Text
re-direct form after s
pop up window controls
Clock on homepage - He
passing a param from a
Password Procection wi
document.title in same
focus onload 
Counting Wrong from Ri
Help needed on how to 

Related stories:

write to an html file dynamically?
FireFox doesn't recognize history.go(-1)
Changing e.keyCode (e.which)
Clearing a range created by element.createTextRange()
UPDATE: My mouse over pop up question
I am having problem with this script!!!
"Login ID" pass over to subsequent pages visited
Checkbox to manipulate Form Field

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics