A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Array issue... as3... pls help.

  1. #1
    Senior Member
    Join Date
    Sep 2006
    Posts
    248

    Array issue... as3... pls help.

    Hello everyone... I am trying to populate my array, but looks like i am only getting the last value... Why is that? And i HAVE to populate it in that weird way of what looks like: Key/value...
    Here is the code:
    Code:
                   var final_info:Array = new Array();
                    var i:int = 0;
                    while (i < (temp_entire_info.length-1))
                    {
                        // name|123|123|place|1218
                        var single_info:Array = temp_entire_info[i].split("|");
    
                        final_info = [{Name:single_info[0], 1_pos:single_info_street[1], 2_pos:single_info[2], place:single_info[3], time:single_info[4]},];
                        i++;
                    }
    Any help will be very welcome...
    Thanks
    Leo.

  2. #2
    Member
    Join Date
    Aug 2012
    Posts
    55
    i think you have to join the name and place and then split them. see the adobe help on this

    http://help.adobe.com/en_US/as3/dev/...0204-7ee8.html

  3. #3
    Senior Member
    Join Date
    Sep 2006
    Posts
    248
    Thank u Rachelg,
    Turns out that i had to change a little the code since it was overwriting the last value. Therefore, i had always just ONE value on my array.
    Here is the code that i got from another source, in case anyone has the same issue:
    Code:
    final_info.push({Street:single_info[0], x_pos:single_info[1], y_pos:single_info[2], Suburb:single_info[3], map:single_info[4]})
    Regards,
    Leo.

  4. #4
    Junior Member
    Join Date
    Sep 2012
    Posts
    2
    I just joined this forum, first forum as well, I need help with adding an array to my code, do I post here or start a new thread?

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