1 Reply Latest reply on Jun 2, 2006 7:15 PM by blemmo

    Sent array from flash to array in asp

    muzila
      I send an array from flash to an asp page as follows:

      _global.addToCart = _global.cartArray.toString();
      getURL(" http://www.custombrackets.com/byb/flashmail.asp?addToCart="+_global.addToCart, "_self");

      on the asp page i grab the array as follows

      <%@ Language=VBScript %>
      <%
      Response.Buffer = true
      Dim tempArray
      tempArray = Request.QueryString("addToCart")
      %>

      I need a way to load the tempArray with the peices in the addToCart array from flash. So the tempArray(0) == addToCart(0), etc.

      Thanks
      Matt
        • 1. Re: Sent array from flash to array in asp
          blemmo Level 1
          When you send the array via GET or POST, it gets sent as a comma separated string, so the website must rebuild the array from that. There should be something like String.explode in VB, that splits a string at a given seperator and returns an array, this would do it.
          But this toString() serialization is bad if the data contains commas as well, and also when the array contains complex data, like objects or nested arrays. In this case, you need some custom serialization of the array data on the Flash side and deserialization on the asp side. The Array.join() method can make that quite easy if the array data isn't too complex.

          hth,
          blemmo