A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Translating HTML into Actionscript

  1. #1
    Join Date
    Dec 2002

    Translating HTML into Actionscript

    I am making an order form in my Flash website. There is an important piece of HTML that I need to translate into Flash terms in order for the form to be compatible with my hosts form-mail script. Here's the line:

    input type="hidden" name="_vDeckformid" value="39"

    Does anyone know how to write this as Actionscript?

  2. #2
    Senior Member jbum's Avatar
    Join Date
    Feb 2004
    Los Angeles
    At some point, the Flash movie is going to post to a CGI script using either getURL or the loadVars object.

    If you use getURL(), you can add that parameter to the URL, e.g:


    If you use loadVars.sendAndLoad() you can make sure that variable is included. Here's a slightly modified example I copied from Colin Moock's Actionscript: The Definitive Guide


    varSender = new LoadVars();
    // ...and one to receive.
    varReceiver = new LoadVars();

    // Assign properties to the sender, which will be the variables sent to the server.
    varSender.name = "Bruce";
    varSender.age = "13";
    varSender._vDeckformid = 39; // <-- SEE???

    // Assign a callback function to the varReceiver's onLoad property.
    // The handler will process the variables when they arrive.
    varReceiver.onLoad = function () {
    // We can access the loaded variables as properties of this, as in this.age.
    // We use a for-in loop to list the properties of the varReceiver object.
    // Note that the loaded and contentType properties are not enumerated.
    for (p in this) {
    // We don't want to list the onLoad property, so check if the
    // current property is a string. If it is...
    if (typeof this[p] = = "string") {
    // ...show its value in the Output window. All loaded
    // variables are received as strings.
    trace("The variable " + p + " has the value " + this[p]);

    // Before sending our variables, we'll display them
    // in the Output window. (Good for debugging)
    trace("Sending " + varSender.toString());

    // Now send the variables to the server, and wait for a reply
    varReceiver, "GET");

    - Jim

  3. #3
    Join Date
    Dec 2002
    Thanks so much!!

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