A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: flash/asp form: new trouble in actionscript 2.0

  1. #1
    Member
    Join Date
    Nov 2002
    Posts
    88

    flash/asp form: new trouble in actionscript 2.0

    I recently upgraded to flash 8 and today I opened a fla of a old info form I used a lot. It's pretty simple: there are a few fields with fixed vars and a button that sends the values to a .asp page that processes a mail.
    To verify the mandatory field, I use the following with the "send" button

    on (release) {
    if ((body ne "") && (name ne "") && (email ne "")) {
    loadVariablesNum("aspflash.asp", 0, "POST");
    gotoAndPlay(12);
    }
    }

    and works like a charm.

    Well, worked.

    I had to made a few adjustments to the form since I was requested to add some components such as a scrollbar for a pretty big field and a checkbox to accept a privacy disclaimer. Since the components (checkbox and UIscrollbar) result in a white area if the movie is published in flash 6, I decided to publish it in flash 8, actionscript 2.0 and now they can be seen and properly used.

    the script I used to validate doesn't work anymore, moreover I get tons of error messages. Just to add some more trouble to this mess, the checkbox component doesn't have a "var" field so I have no idea how to make it mandatory as the other fields...can you spare a little time to explain me what's wrong with ac2.0?

  2. #2
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    Actionscript 2 is okay, but there were significate changes from AS 1.0 to AS 2.0...not as many as are appearing each day in AS3.0.

    The code you provided seems okay. To help you out, I need to see the full code you are currently using and possible the error messages you're receiving. With the checkbox, you are going to use the "instance" name to check if instanceName.checked = true. If so, then more on or enable a button or something like that.

    If you post the code with the error messages (at least one) we should be able to troubleshoot and correct the issue fairly quickly.
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  3. #3
    Member
    Join Date
    Nov 2002
    Posts
    88
    first thing first, thank you for the answer, I could not respond earlier since my mobo is a bit faulty.

    now I'll clarify all as much as I can. I made a few changes and I solved everything. Since you were so kind to answer me I'll show you how I used your precious advice.

    There are 10 fields, 9 are mandatory.

    the button has the following code


    on (release) {
    if ((body ne "") && (nome ne "") && (privacy.selected ne false) && (cognome ne "") && (indirizzo ne "") && (cap ne "") && (citta ne "") && (provincia ne "") && (stato ne "") && (email ne "")) {
    loadVariablesNum("aspflash.asp", 0, "POST");
    gotoAndPlay(3);
    }
    }

    I had to specify the initial status of the single vars, otherwise on the pression of the submit button the form would go ahead and process the data o the asp page.

    So on the first frame I used

    cap = "";
    body = "";
    cognome = "";
    indirizzo = "";
    nome = "";
    stato = "";
    citta = "";
    provincia = "";
    email = "";
    privacy.selected = false;
    gotoAndStop(2);

    and the second frame is where the form stops to have its fields filled.

    Now it works great, I hope that my experience can be helpful.

    Thank you for your hints

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