![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
I want to load an array. This is the way I need to do it. This is the way I
could in visual basic. I have not see it in Flex 2 checking the tutorials. Does it exist? var myArray:Array = new Array(); myArray.(1) = string1; myArray.(2) = string2; Thanks, BudHud |
| Sponsored Links |
|
|||
|
"BudHud" <webforumsuser@macromedia.com> wrote in message news:gc3uoq$rkn$1@forums.macromedia.com... >I want to load an array. This is the way I need to do it. This is the way >I > could in visual basic. I have not see it in Flex 2 checking the > tutorials. > Does it exist? > > var myArray:Array = new Array(); > myArray.(1) = string1; > myArray.(2) = string2; myArray[0] ='string1'; or myArray.push('string1') |
|
|||
|
As I believe you are interested in adding variables to the array, this may be
more what you need: <?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="initData();" > <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; private var myArr:Array = new Array(); private var string1:String = "This is string1."; private var string2:String = "This is string2."; private var string3:String = "This is string3."; [Bindable] public var TileListdp:ArrayCollection; private function initData():void { myArr.push(string1); myArr.push(string2); myArr.push(string3); TileListdp = new ArrayCollection(myArr); } ]]> </mx:Script> <mx:ComboBox dataProvider="{TileListdp}"/> </mx:Application> |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise