9 Replies Latest reply on May 9, 2006 7:41 AM by exPluda?

    Updating AS1 to AS2?

    sunday_driver
      Hi I am new to AS and Flash but I have a form that is perfect for my needs, but it seems that it was built in an earlier version of Flash. So when I add it to my existing site, code errors come up when outputting. I am using Flash 8. It is a flash form with input boxes and one drop down (not components). Here is the script that's on the 'Submit' button.

      on (release) {
      if (title eq "" or name eq "" or subject eq "" or message eq "" or email eq "" or ssl eq "" or coffee eq "") {
      stop();
      } else {
      loadVariablesNum("form.php", 0, "POST");
      gotoAndStop(2);
      }
      }
      ___________________________________________________________________________________

      And this is on the ' Clear' button:

      on (release) {
      title = "Please select a title";
      name = "";
      subject = "";
      message = "";
      email = "";
      tellTarget ("_root.ssl") {
      gotoAndStop(1);
      }
      tellTarget ("_root.coffee") {
      gotoAndStop(1);
      }
      }
      ___________________________________________________________________________________

      One of the main error messages is: Unexpected '}' encountered }.

      Not sure what this means or what is goign on here. If anyone know how to update this script or have something better, that would be amazing. Thanks
        • 1. Re: Updating AS1 to AS2?
          exPluda?
          try with this

          on(release) {
          if (title == "" && name == "" && subject == "" && message == "" && email == "" && ssl == "" && coffee == "") {
          stop();
          } else {
          loadVariablesNum("form.php", 0, "POST");
          gotoAndStop(2);
          }
          }
          • 2. Re: Updating AS1 to AS2?
            sunday_driver Level 1
            Thanks for that, but still giving me the same errors!

            These are just some of the errors coming up:

            **Error** Symbol=sslcheck, layer=boxex, frame=1:Line 2: Unexpected '/' encountered
            /:ssl = "PHP";

            **Error** Symbol=sslcheck, layer=boxex, frame=1:Line 3: Statement must appear within on handler
            gotoAndStop(2);

            **Error** Symbol=sslcheck, layer=boxex, frame=1:Line 4: Unexpected '}' encountered
            }

            **Error** Symbol=sslcheck, layer=boxex, frame=1:Line 2: Unexpected '/' encountered
            /:ssl = "CF";

            **Error** Symbol=sslcheck, layer=boxex, frame=1:Line 3: Statement must appear within on handler
            gotoAndStop(5);

            **Error** Symbol=sslcheck, layer=boxex, frame=1:Line 4: Unexpected '}' encountered
            }

            **Error** Symbol=sslcheck, layer=boxex, frame=1:Line 2: Unexpected '/' encountered
            /:ssl = "ASP";
            • 3. Re: Updating AS1 to AS2?
              exPluda? Level 1
              ok, so your error is not in that piece of code...

              post the entire code or a link to your file so we can have o deeper look
              • 4. Re: Updating AS1 to AS2?
                sunday_driver Level 1
                Hi exPluda

                Here is a link to the tutorial as this is the one I am using.

                http://www.fwzone.net/ShowDetail.asp?NewsId=829

                I think the problem is I have built site in Flash 8, publishing it as 8 with AS2. So when this form is put in at a specific frame, when I go to publish it, the errors come up. When publishing it as something earlier with AS1 in publish setting on, no errors appear but site doesn't work!

                The thing is, it's the only tutorial I can find like this that using both input and drop downs. I can't find anyting with components etc. My head is melting!

                Maybe you have used something similar?

                Thanks though
                • 5. Re: Updating AS1 to AS2?
                  exPluda? Level 1
                  ok, replace this

                  /:

                  by

                  _parent.

                  and your error will be gone
                  • 6. Re: Updating AS1 to AS2?
                    sunday_driver Level 1
                    Wow that seems to be working alright! Thanks alot. You're a saviour!

                    Is this a good piece of code or is there a better way of doing this?

                    Also I am still getting this message but the code seems fine?

                    **Error** Symbol=title, layer=options, frame=15:Line 3: Statement must appear within on handler
                    gotoAndStop("hide");
                    • 7. Re: Updating AS1 to AS2?
                      exPluda? Level 1
                      **Error** Symbol=title, layer=options, frame=15:Line 3: Statement must appear within on handler
                      gotoAndStop("hide");

                      this is not in the file you link to us, so i can't know what may be the problem.

                      I think there are some better examples of flash/php email form, even in this foruns, just search for email and you will get some good examples.

                      • 8. Re: Updating AS1 to AS2?
                        sunday_driver Level 1
                        Thanks a lot anyway for that. I sent my first Flash form! It works anyway even though there might be better, but gets my out of a jam.

                        Thanks again.
                        • 9. Re: Updating AS1 to AS2?
                          exPluda? Level 1
                          you're welcome