Adobe Dreamweaver Forums



Last 10 THreads :         Can't upload selected pdf's to remote server (Last Post : DontTazeMeBro - Replies : 3 - Views : 4 )           »          dreamweaver v. movable type? (Last Post : Murray *ACE* - Replies : 2 - Views : 3 )           »          Disabling menu bars in a browser window (Last Post : Dooza - Replies : 4 - Views : 5 )           »          drop down menu over flash (Last Post : Murray *ACE* - Replies : 1 - Views : 2 )           »          uploading site (Last Post : hrggroup - Replies : 4 - Views : 5 )           »          Can Anyone Help With Sub Menus (Last Post : Murray *ACE* - Replies : 6 - Views : 7 )           »          help with DWCS3 (Last Post : Murray *ACE* - Replies : 4 - Views : 5 )           »          Repeater and XML problem (Last Post : ntsiii - Replies : 2 - Views : 4 )           »          Focus, Browsers & Spry Accordion (Last Post : CORDFrank - Replies : 5 - Views : 7 )           »          Navigation from Contact Form (Last Post : sw2gtg - Replies : 3 - Views : 6 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 10-03-2008, 03:14 AM
BudHud
 
Posts: n/a
Diggs:
Default Loading an Array

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



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-03-2008, 03:40 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Loading an Array


"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')


Reply With Quote
  #3 (permalink)  
Old 10-03-2008, 04:03 AM
BudHud
 
Posts: n/a
Diggs:
Default Re: Loading an Array

Try this:

var myArr:Array = new Array();
myArr[0] = "January";
myArr[1] = "February";
myArr[2] = "March";
myArr[3] = "April";

BudHud
Reply With Quote


  #4 (permalink)  
Old 10-03-2008, 05:46 PM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: Loading an Array

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>

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 06:02 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk