A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [MX04] external data file to import variable to array

  1. #1
    Member
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    60

    [MX04] external data file to import variable to array

    Hello,

    I have managed to load a variable "movies" from an external ".txt" file but there is a lag before it shows up. The code is:
    PHP Code:
    loadVariablesNum("data.txt"0); 
    Then, I've got a code where I need the loaded variable "movies" to be used as a component of a for loop.
    PHP Code:
    //new array
    arr1 = []; 
    //create entries with number of entries as required
    for (var n=0n!=moviesn++) arr1.push(n); 
    trace("before sort - "+arr1); 
    If I declare the variable outright (i.e.movies = 10) the second part also works; I just can't get the loaded variable in there. Any suggestions?
    In skating over thin ice, our
    safety is in our speed.

  2. #2
    Senior Member
    Join Date
    Jul 2005
    Posts
    165
    Come to the Future: use LoadVars, then use its onLoad event.

  3. #3
    Member
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    60
    Sorry. My knowledge at this depth is very limited, but I'm getting there. Thanks for your help.
    In skating over thin ice, our
    safety is in our speed.

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