-
Loading External Data
I have an external text file that will have two variables and look like this:
&months=January,February,...&days=Sunday,Monday,.. .
I am using loadVars to load the textfile in. When it is done loading, I want to load each of the of the 2 variables into an array so I have an array for months and array for days. Can anyone help me with this.
Thanks... Bubba
-
Senior Member
Hi
Here ya go....actions are on the buttons.
2 buttons to load the text vars (&months,&days) into 2 dynamic text boxes (text,text2) and split them into arrays....
The arrays are then displayed in 2 other dynamic text boxes(arrayMonth,arrayDay)....
The other 2 buttons can then display certain items in the arrays when pressed..
Last edited by hum; 01-13-2006 at 07:49 PM.
-
Try this sample actionscript
You can use split() to create array of month and day. As an example:
months="January,February,March,April,May,June,July ,August,September,October,November,December";
days="Monday,Tuesday,Wednesday,Thursday,Friday,Sat urday,Sunday";
Your months and days entries are separated by comma ",".
The AS on your FLA is something like this:
Code:
var mm_array = new Array();
var day_array = new Array;
mm_array = months.split(",");
day_array = days.split(",");
Last edited by chessgenie; 01-13-2006 at 08:51 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|