[flexcoders] Re: Array Collection
Something like ... for each (var member in membData) mEdit.membAccounts.push(member.usraccount); not sure what to type member though? - Stephen
Re: [flexcoders] Re: Array Collection
The type depends on what the items in the ArrayCollection are. You can use Object if you’re not sure. The cost of using Object is generally ignorable. On 2/20/10 11:31 AM, criptopus sd_br...@ntlworld.com wrote: Something like ... for each (var member in membData) mEdit.membAccounts.push(member.usraccount); not sure what to type member though? - Stephen -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] Re: Array Collection
--- In flexcoders@yahoogroups.com, thelordsince1984 lore...@... wrote: Hi, i've have an array collection of objects...every object is like this one: - id:path private function create(id:String, path:String):void { var arrayCollection:ArrayCollection = new ArrayCollection(); var o:Object = {id:path}; arrayCollection.addItem(o); } i would create a function that has a parameter, the id, and check if there is a correspondence between the parameter id function and that one into the array collection. In this case i would also trace the path value... can you help me? thanks Regards Lorenzo it's ok.. instead if i would parse an object that contains strings? for example i've an object that has three strings like this - test1, test2, test3 so i would trace strings separately..how can i do this?
RE: [flexcoders] Re: Array Collection
If it is a dynamic object, you can use for..in or for..each loops to enumerate all of the properties. Note, If you have an object, like: var oLookup:Object = {p1:v1, p2:v2, pa:va, pb:vb}; You can randomly access the properties like this: var sPropertyName:String = pa; var sPropertyValue:String = oLookup[sPropertyName]; Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of thelordsince1984 Sent: Thursday, February 05, 2009 6:20 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Array Collection --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , thelordsince1984 lore...@... wrote: Hi, i've have an array collection of objects...every object is like this one: - id:path private function create(id:String, path:String):void { var arrayCollection:ArrayCollection = new ArrayCollection(); var o:Object = {id:path}; arrayCollection.addItem(o); } i would create a function that has a parameter, the id, and check if there is a correspondence between the parameter id function and that one into the array collection. In this case i would also trace the path value... can you help me? thanks Regards Lorenzo it's ok.. instead if i would parse an object that contains strings? for example i've an object that has three strings like this - test1, test2, test3 so i would trace strings separately..how can i do this?
[flexcoders] Re: Array Collection Column Value
use .getItemAt() instead of [] --- In flexcoders@yahoogroups.com, sanjaypmg [EMAIL PROTECTED] wrote: Hi, I have an ArrayCollection with various columns. I need to populate different combos using this array collection columns. I have a method where I am passing only column name as a parameter like: public function initArra(curColName:String):void{ var totalLen:int = tempArrCol.length; Alert.show(tempArrCol.toString()) for(var i:int =0; itotalLen; i++){ var t:String = this[tempArrCol[+i+].Gold]//+this[curColName] listArray.push(t); //t = tempArrCol[i].curColName; comboBoxes_curColName.dataProvider = listArray; Alert.show(t) } } But here I am not able to get the list of ArrayCollection using this []. How can I get the list of the respected columns? Pls suggest. Thanks in advance.. Sanjay sharma