I have the following snippet of code which illustrates a problem that
I'm having.  I have an event listener within a class that I'd like to
have be "self aware".  I'd like it to be able to call another function
within the Class but I haven't found the right method to have it do
so.  Please advise:

<!DOCTYPE html>
                <script type="text/javascript" src="../prototype.js"></script>
                <style type="text/css">
                        #box{position:fixed;width:100px;border:3px solid 
align:center;padding:50px 25px;cursor:pointer;}
                <script type="text/javascript">
                        var MyOBJ = new Class.create();
                        MyOBJ.prototype = {
                                initialize: function(){
                                takeAction: function(event){
                                        alert("I got to this function without 
                                anotherAction: function(){
                                        alert("I won't get here.");

                        document.observe("dom:loaded", function(){
                                var spriteOBJ = new MyOBJ();
                <div id="box">BOX</div>

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 
For more options, visit this group at 

Reply via email to