A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Pass variables to HTML form

  1. #1
    Junior Member
    Join Date
    Jul 2000
    Posts
    29
    I need to pass 2 variables from my Flash movie to an HTML form created by someone else.

    I guess I will use the Load Variables script but what else will I need to do.

    Thanks,



    Chris

  2. #2
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    Firstly in-between the head tags in your html page put:

    <script language="JavaScript">
    function recievevariables(flashvalue)
    {
    document.form.textfield.value = flashValue;
    }
    </script>

    Then in between your body tags in your hmtl page put:

    <form name="form">
    <input type=text name="textfield" value="">
    </form>

    Now inside your flash movie create a variable:

    set variable: "var" = "value"

    Then create a button and give it the following actions:

    on(press)
    "javascript:recievevariables(\""&var&"\")"
    End on


    That should now send the variable "var" to the html form and the textfield in the html form "textfield" will display it!!


    Hope that helps!!
    Regards FlashGuru


  3. #3
    Junior Member
    Join Date
    Jul 2000
    Posts
    29
    Thanks Doc,

    This could help me end this project I have been working on for far too long

    Chris

  4. #4
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    No problem

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