Send an array from Flash 8 to PHP

Ask a Question related to Macromedia Flash Data Integration, Design and Development.

  1. #1

    Default Send an array from Flash 8 to PHP

    Hi guys.
    I am using flash 8 and actionscript 2
    I have created an array in flash to send to php using getURL and POST.
    i.e.
    on (release) {
    var id:Array = new Array();
    id.txt_4 = 'nopanels';
    id.txt_2 = 'xheight';
    id.txt_3 = 'xwidth';
    id.txt_1 = 'colortext';
    id.txt_5 = 'shutterstyle';
    id.txt_7 = 'finish';
    id.txt_6 = 'squarearea';
    getURL("test.php", "_self", "POST");
    }

    Then I am trying to receive the array in a php file called 'test.php' and
    print it to test that it works.

    i.e.

    <?php
    //incoming data
    $id['txt_4'] = $_POST['id']['txt_4'];
    $id['txt_2'] = $_POST['id']['txt_2'];
    $id['txt_3'] = $_POST['id']['txt_3'];
    $id['txt_1'] = $_POST['id']['txt_1'];
    $id['txt_5'] = $_POST['id']['txt_5'];
    $id['txt_7'] = $_POST['id']['txt_7'];
    $id['txt_6'] = $_POST['id']['txt_6'];
    //display
    print $id['txt_4'];
    print $id['txt_2'];
    print $id['txt_3'];
    print $id['txt_1'];
    print $id['txt_5'];
    print $id['txt_7'];
    print $id['txt_6'];
    ?>

    I am trying to make it 'register globals = off' compatible.

    Any help is appreciated. :confused;

    grungie Guest

  2. Similar Questions and Discussions

    1. XML.send() in a Flash Projector
      Hi, I need to post some XML from a Flash Projector to an ASP web application on the same machine. The web app is running as something like...
    2. send XML from Flash to PHP
      hi! i create an xml in flash and want to save it on the server. i user my_xm.send("script.php"); to send the created xml, but don't know how to...
    3. Flash to CFM via loadvars.send()
      Does anyone know when you use loadvarsObj.send("index.cfm","_blank","post") which scope the variables are presented to CF in? I had assumed that...
    4. Send email from Flash with asp
      Dose anyone knows where i can find a tutorial about this?
    5. Send data to Flash from a page without reloading the flash file
      The title tells the most, I want to send like, "hello" to a flashfile from a html page(the flash file is on the site) without having to reload the...
  3. #2

    Default Re: Send an array from Flash 8 to PHP

    use the loadVars object. In the code above you are not making any reference to your variables when using getURL. You can't use getURL for this one, you need to use LoadVars
    GenaroRG Guest

  4. #3

    Default Re: Send an array from Flash 8 to PHP

    See my post above (migrating mySQL from localhost to server).

    The best advice anybody gave me on this forum was to get the book "PHP5 for
    Flash" by David Powers. (Friends of Ed- publisher who also has a website) It
    has numerous examples and details and can do more than a quick reply on this
    forum.

    MYSCREENNAMEISUNAVAILABLE Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139