Form Action associated with a button within FLash movie

Posted on 2005-04-30
Last Modified: 2010-04-03
I want to assign the following html code to a button within a flash movie:

<form action="" method="POST">
     <input type="hidden" name="required" value="realname,email">
     <input type="hidden" name="recipient" value="info">
     <input type="hidden" name="subject"      value="Information">
     <input type=hidden name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT,REMOTE_ADDRtest3">

In a HTML doc, this would hit the CGI script and automatically send their comments to the info email address. How would I go about this within a flash movie?
Question by:dripa
    LVL 18

    Expert Comment

    on the button in flash, put this code:
    gotoAndPlay("loading");//where loading is a frame label name of a loop following the button

    If you are returning variables to flash, then make sure your cgi script returns a final variable like:

    then in flash, in the above mentioned loop:
    gotoAndStop("succeeded");//where suceeded is the frame label for the frame where you wish to display your returned variables

    LVL 9

    Accepted Solution

    you can use loadVars():

    Timeline, frame 1, add the following action scripts:

    //below is similar to  <form>
    forwardData = new LoadVars();

    //below is similar to hidden parameters
    forwardData.required = "realname,email";
    forwardData.recipient = "info";
    forwardData.subject = "Information";
    forwardData.env_report = "REMOTE_HOST,HTTP_USER_AGENT,REMOTE_ADDRtest3";

    //below is similar to press submit button
    forwardData.send("", "POST");

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
    The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now