A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Sorting data from a text file using php

  1. #1
    theSWEEN thesween's Avatar
    Join Date
    Nov 2005
    Location
    Hertfordshire, England
    Posts
    305

    Sorting data from a text file using php

    Hello,

    I can make a guest book using km and a php file, which writes info to a text file. I use the following to load the data into a dynamic text box(you've probably seen it before)..

    Ecran = "loading entries ...";
    var gbend = 1;
    gbpage = 1;
    vr1 = 0;
    vr2 = "No";
    this.loadVariables("/shoutbox/shoutbox.php?vr1="+vr1+"&vr2="+vr2+"&R="+random(99 9));
    stop();

    Does anyone know of a way of using the same method of retrieving data but loading it all in a particular order?..

    For example, if the movie records the age and name into a text file.. then the movie loads the info in age order, oldest at the top of the list.

    Hope that makes sense..

    Thanks again in advance..

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Using LoadVars instead you can access the Raw data loaded with onData and using the string function split to get each line into an array, you can then sort the array. This is a trick I learned from Wilburt.

    Here's a good thread where it's explained.
    http://board.flashkit.com/board/showthread.php?t=753298

  3. #3
    theSWEEN thesween's Avatar
    Join Date
    Nov 2005
    Location
    Hertfordshire, England
    Posts
    305
    Thanks Bret, I think I can get my head around this! Cheers!

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