kwhubby
03-30-2003, 09:18 AM
Hi i am trying to make a function of an object that can be used, such as the random generater function: Math.random() wich is the function random, which is part of the object Math. Ive never needed to do this before so I am just curious how it would be down. I know how to make values of an object like abc = new Object(); abc.asdf = "hello"
Ive tried doing something like abc = new Object(); abc.asdf = new function() { alert("hi") }
but I cant seem to figure out how to be able to make it right since if I were to do abc.asdf() it would give error.
I would appreciate anybody instructing me on how to do this.
Ive tried doing something like abc = new Object(); abc.asdf = new function() { alert("hi") }
but I cant seem to figure out how to be able to make it right since if I were to do abc.asdf() it would give error.
I would appreciate anybody instructing me on how to do this.