I want to break free... of my function-scope

Tarik's icon

Hi,

I want to be able to send a certain message to my js-object. For instance "add billy", which will then cause another global function (named billy) to be made. I want to do this by using the eval() function.

The problem is: I don't know how to 'break out' of the scope of the function in which I'm writing my function-generator. So I keep getting a function within a function, instead of a global one.

Help will be appreciated!

- T

Tarik's icon

Problem solved:

I can just say: this.newglobalfunc = function()

Well, let's hope that at least somebody else learns something useful from this...