I need to create a flash file that contains a form with text fields that will use the get method to pass the input field values as url variables. I have searched and search and for the life of me can not find a way to to do this. I need it to work just like an html form where the ACTION url along with the form values are passed and opened up in a new window. Can anyone point me in the right direction???

Dani AI

Generated

Short answer for : in Flash CS3 use ActionScript to build the query string and call navigateToURL with the GET method so the browser opens the target in a new window. already pointed to tutorials — below are concise, copy-paste-ready examples (AS3 and AS2) and key troubleshooting notes so the behavior matches an HTML form.

AS3 (Flash CS3 / ActionScript 3.0). Put this on the main timeline or in your document class. Ensure your text inputs are Input-type fields with instance names like name_txt and email_txt, and your submit button is submit_btn:

import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import flash.net.URLVariables;

submit_btn.addEventListener(MouseEvent.CLICK, submitForm);

function submitForm(e:MouseEvent):void {
    var vars:URLVariables = new URLVariables();
    vars.name = name_txt.text;
    vars.email = email_txt.text;

    var req:URLRequest = new URLRequest("http://www.example.com/process.php");
    req.method = URLRequestMethod.GET;
    req.data = vars;

    try {
        navigateToURL(req, "_blank");
    } catch (err:Error) {
        trace("Failed to open URL: " + err.message);
    }
}

AS2 fallback (if your FLA uses ActionScript 2.0):

var lv:LoadVars = new LoadVars();
lv.name = name_txt.text;
lv.email = email_txt.text;
getURL("http://www.example.com/process.php?" + lv.toString(), "_blank");

Troubleshooting and caveats: give each input an instance name (not a variable name on the stage). URLVariables and LoadVars handle encoding; do not hand-concatenate unescaped strings for production. Browser popup blockers can stop windows opened outside a direct click handler — keep the navigateToURL call directly in the click event. GET appends data to the URL and can hit browser length limits (use POST for large payloads). If you need the SWF to read cross-domain responses, a crossdomain.xml is required. Finally, Flash Player reached end-of-life in 2020 — for new projects prefer an HTML form + JavaScript approach or server-side endpoints for long-term compatibility.

Recommended Answers

All 2 Replies

Sorry, I need to learn first about that

I think you did not search hard enough, here is tutorial from , plus here is more resources from google search

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.