On 3/27/06, Daniel Herrero <[EMAIL PROTECTED]> wrote: > Now I have another cuestion related to this: I have a class with an object > inside: > > var onewClass = Class.create(); > onewClass.prototype = { > initialize : function() { > this.variable = "fooo"; > }, > myrules : {"fooo" : this.variable > > } > }; > and I intance it like this: > var newClass = new onewClass(); > if I do alert(newClass.myrules.fooo) it doesn´t show "fooo". How can I do > to correct this? Thank you!!
fooo is being set at "compile time" to this.variable which isn't defined until you call new onewClass(). Just define this.myrules in initialize() and you should be able to access them via newClass.myrules like in your example. Ryan, the quotes around fooo are valid syntax. Todd _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs