Thanks Tracy I put that into a try catch statement and still get the ReferenceError: Error #1069 but it's working now? Should i be concerned with the error
I tried only one line to less complicate things try{ this["public_" + whichmeal + "_image1"] = urlpath + createmeal_http.lastResult.breakfast.itemdata[id].imgsource; }catch(err:Error){ Alert.show(err.toString()); } --- In flexcoders@yahoogroups.com, "Tracy Spratt" <tr...@...> wrote: > > {Braces} are not legal in Actionscript except to create a new Object, or in > literal XML. > > > > You probably want something like: > > this["public_" + whichmeal + "_item1_label"] > > > > Tracy Spratt, > > Lariat Services, development services available > > _____ > > From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On > Behalf Of Jason B > Sent: Friday, May 08, 2009 9:37 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] dynamic labels with public variable > > > > > > > > > I'm trying to set a set of labels but its based on public variable > whichmeal. > > Is there a special way to use these labels dynamically? > > try{ > this["public_{whichmeal}_item1_label"] = item1_label.text; > this["public_{whichmeal}_serving1_label"] = serving1_label.text; > }catch(err:Error){ > Alert.show(err.toString()); > } > > Shows > Reference Error 1069 > Reference Error 1056 >