A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [Flex] simple datagrid

Threaded View

  1. #4
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,786
    I would use XML personally, but a simple parsed string would do as well. With XML, all you would have to do is set the dataProvider of the grid. In any case, here is a long winded AS3 sendAndLoad equiv (havn't checked syntax so there may be some typos &c):

    var search_request : URLRequest = new URLRequest ("search.php");

    var search_variables : URLVariables = new URLVariables ();

    search_variables.filter = "search filter";

    search_request.data = search_variables;

    var search_loader : URLLoader = new URLLoader (search_request);

    search_loader.addEventListener (Event.COMPLETE, searchCompleteHandler);

    function searchCompleteHandler (event : Event) : void {
    trace (search_loader.data);
    //total=2&img0=1.jpg&link0=1.htm&img1=2.jpg&link1=2. htm

    var result_variables : URLVariables = new URLVariables (search_loader.data);

    var soundsLen : uint = result_variables.total;
    for (var sound : uint; sound < soundsLen; sound++) {
    var img : String = result_variables["img" + sound];
    var link : String = result_variables["link" + sound];
    // add item to grid / data provider
    }
    }
    Last edited by gSOLO_01; 08-22-2006 at 02: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