I am working on a class now and part of the initialization is adding
event listeners to an object.  I'd like to pass some value through to
the functions that are attributes of the class but I can't seem to
figure it out.  Here's a sample piece of the code:

var MyClass= new Class.create();
MyClass.prototype = {
        initialize: function(id,name,top,left){
                try{
                        this.id = id;
                        this.name = name;
                        this.currentTop = top;
                        this.currentLeft = left;

                        $(id).addEventListener("mousedown",function(this.id){
                                alert(this.id);
                                this.myFunction(this.id);
                        },false);

                }
                catch(error){alert(error);}
        },
        myFunction:function(event){
                this.mouseState++;
                $('status').innerHTML = "The object has been picked up. ||
mouseState is " + this.mouseState;
        }
};

Any suggestions would be much appreciated.

 - MT

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to