Hello I´m making a class using prototype's class.create(), like this:
var >onewClass.prototype = {
    initialize : function(array) {
        this.variable = "fooo";
        this.array = array;
    },
    function1 : function() {
        this.array.each(function(element){
                       alert(element);
                       alert(this.variable);
                  });
    }
};

and I intance it like this:
var array = ("house", "car", "tree");
var newClass = new onewClass(array);
newClass.function1();
The problem is that the alerts appear, but this.variable says "undefined", how can i do to make it say "fooo", as is declarated in the initialize part? Thank you and sorry for my english :) :) !!
--
Daniel Herrero Dávila
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to