dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Breaking My head

  1. #1
    Member
    Join Date
    Aug 2002
    Posts
    37

    Breaking My head

    How come something so simple isn't working for me.

    I'm passing a variable from html into my swf using:

    HTML Code:
    <param name="movie" value="mypage.swf" />
    <param name="FlashVars" value="cust_id=65" />
    <embed src="mypage.swf"  FlashVars="cust_id=65"/>

    then I create a text field in flash with the variable name myVar and attach the following code to it:

    Code:
    onClipEvent (load) {
     loadVariables("test.php", this, "GET");
    }

    in the php page i have:

    PHP Code:
    <?php

    echo "&myVar= $_GET[cust_id] "

    ?>

    when i test the movie on the server, the PHP file should take the cust_id variable from the swf and display it in the text field, but it's not working for me.

    am i missing a step?

    thanks for your help.

  2. #2
    Member
    Join Date
    Aug 2002
    Posts
    37
    do i need a code to actualy send the variables to the php?

  3. #3
    absent
    Join Date
    Aug 2000
    Location
    NB, Canada
    Posts
    155
    No need for PHP. In this case, by putting the data in HTML, you are sending that variable to the Flash directly. You just need to tell your text field to use that information.

    myTextField.text = cust_id;

    g'luck!
    - g

  4. #4
    Member
    Join Date
    Aug 2002
    Posts
    37
    thanks, I tried that to make sure that the variable is being passed into the flaash and it works fine, but how do i send that variable to a php file and varify that the php file is getting it?

    I hope that makes sense.

  5. #5
    absent
    Join Date
    Aug 2000
    Location
    NB, Canada
    Posts
    155
    I'm afraid my Flash to PHP experience is limited.
    I've only sent variables from Flash to PHP using the getURL("filename.php", "", "POST"); method, something like this tutorial:
    http://www.webclass.ru/eng/Tutorials...data_from.html
    - g

  6. #6
    Member
    Join Date
    Aug 2002
    Posts
    37
    Thanks again, I've used that method in the past as well but the getURL opens a new page, but I just want to send the variables to the PHP.

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