private function createData():Void { this._data = {a:{t1:0, t2:0}}; }
One line. :) > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Mendelsohn, Michael > Sent: Friday, February 09, 2007 11:02 AM > To: Flashcoders mailing list > Subject: RE: [Flashcoders] Identifier expected > > Thanks Jason. I see what you're saying. So I inited an > object and then define it, but the below still errors. I was > just hoping to be able to define my object with only one line of code. > > private function createData():Void { > this._data = new Object(); > this._data["a"] = new Object(); > this._data["a"] = {"t1":0, "t2":0}; > } > > > I was using new Number for a reason, but it's not critical I suppose. > Thanks Steven. > > - Mike > > > > > > > The second line does not work because you are evaluating a > string to try to resolve it to a property of the object, > (which you are hoping is a > sub-object) that does not exist yet. In other words, > > this._data.a > > the .a in the above statement has not been declared or > identified as an object, and thus this._data["a"] resolves to nothing. > _______________________________________________ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com http://training.figleaf.com > _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com