A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Loading External Data

  1. #1
    Senior Member
    Join Date
    Aug 2003
    Location
    California
    Posts
    149

    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

  2. #2
    Senior Member hum's Avatar
    Join Date
    Sep 2003
    Location
    CloudCuckooland
    Posts
    1,714
    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.

  3. #3
    Senior Member
    Join Date
    Dec 2005
    Location
    Sydney,Australia
    Posts
    101

    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center