Object Oriented Problem

Object Oriented Problem

Hi all,

I am wondering how to do this:

  1. function MyObject(){
  2.       this.callMe = function(){
  3.             alert("I am called!");
  4.       };
  5.       $("#myButton").click(function(){
  6.             // How can I call the above callMe function?
  7.             // this.callMe(); // Not working
  8.             // callMe();       // Not working
  9.       });
  10. }

Error messages I am getting on above are:
  1. this.callMe(); is not a function
  2. callMe(); is not defined

Thanks
Mahesh