talking between flash and php

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • windandwaves

    talking between flash and php

    Hi Folk

    I am new to flash (just so you don't think I am completely stupid)

    I have a flash file that I want to execute a short action script and then
    load a PHP file in the its own window, while posting some of the variables
    to this new script:

    e.g.
    A
    B
    C
    //below is where I get stuck
    post variables:
    x = 1;
    y = 2;
    open new url = 'test.php' with post variables
    //end

    in test.php I then want to be able to show those variables as follows:

    <?php
    echo $_POST["x"];
    echo $_POST["y"];
    ?>

    I have the ABC, but I need the correct syntax for the last few lines in
    flash.

    TIA

    - Nicolaas







  • usenet@isotopeREEMOOVEmedia.com

    #2
    Re: talking between flash and php

    On Tue, 4 Oct 2005 13:05:20 +1300, "windandwav es" <winandwaves@co ldmail.com>
    wrote:[color=blue]
    >I have a flash file that I want to execute a short action script and then
    >load a PHP file in the its own window, while posting some of the variables
    >to this new script:
    >
    >e.g.
    >A
    >B
    >C
    >//below is where I get stuck
    >post variables:
    > x = 1;
    > y = 2;
    >open new url = 'test.php' with post variables
    >//end
    >
    >in test.php I then want to be able to show those variables as follows:
    >
    ><?php
    > echo $_POST["x"];
    > echo $_POST["y"];
    >?>
    >
    >I have the ABC, but I need the correct syntax for the last few lines in
    >flash.[/color]

    If you're sending the values with no regard for server response, you can append
    the values to the URL in Flash using GET syntax:
    Agentforce 360 Platform (Formerly Salesforce Platform) powers the Agentic Enterprise, combining metadata, governance, MuleSoft and Data Cloud.


    If you need bidirectional communication, look into the Flash LoadVars and
    LoadVariables objects.


    HTH.

    Comment

    • windandwaves

      #3
      Re: talking between flash and php

      usenet@isotopeR EEMOOVEmedia.co m wrote:[color=blue]
      > On Tue, 4 Oct 2005 13:05:20 +1300, "windandwav es"
      > <winandwaves@co ldmail.com> wrote:[color=green]
      >> I have a flash file that I want to execute a short action script and
      >> then load a PHP file in the its own window, while posting some of
      >> the variables to this new script:
      >>
      >> e.g.
      >> A
      >> B
      >> C
      >> //below is where I get stuck
      >> post variables:
      >> x = 1;
      >> y = 2;
      >> open new url = 'test.php' with post variables
      >> //end
      >>
      >> in test.php I then want to be able to show those variables as
      >> follows:
      >>
      >> <?php
      >> echo $_POST["x"];
      >> echo $_POST["y"];[color=darkred]
      >>>[/color]
      >>
      >> I have the ABC, but I need the correct syntax for the last few lines
      >> in flash.[/color]
      >
      > If you're sending the values with no regard for server response, you
      > can append the values to the URL in Flash using GET syntax:
      > www.site.com/page.php?x=1&y=2
      >
      > If you need bidirectional communication, look into the Flash LoadVars
      > and LoadVariables objects.
      > http://www.actionscripts.org/tutoria..._and_loadVars/[/color]


      This is what I came up with in Flash:

      stop();
      var ses:string;

      //create the local Shared Object
      myLocalSO = sharedobject.ge tLocal("hookie" );

      if(_root.destro y) {
      myLocalSO.data. name = "destroyed" ;
      }
      else {
      //if cookie already exists then get ses from cookie
      if (myLocalSO.data .name.length == 32) {
      ses = myLocalSO.data. name;
      getURL("index.p hp", "_self", "GET");
      }
      //if cookie does not exist then make it
      else {
      //get parameter from query string (INPUT)
      //if(_root.PHPSES SID){
      // ses = _root.PHPSESSID ;
      // getURL("episode .php", "_self", "GET");
      //}
      //if(ses.length <> 32) {
      // ses = "testcookie " + getTimer()
      //}
      myLocalSO.data. name = _root.PHPSESSID ;
      }
      ses = myLocalSO.data. name;
      getURL("voter.p hp", "_self", "POST");
      }


      Comment

      Working...