Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Updating AS1 to AS2?

New Here ,
May 09, 2006 May 09, 2006
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
TOPICS
ActionScript
472
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 09, 2006 May 09, 2006
try with this

on(release) {
if (title == "" && name == "" && subject == "" && message == "" && email == "" && ssl == "" && coffee == "") {
stop();
} else {
loadVariablesNum("form.php", 0, "POST");
gotoAndStop(2);
}
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 09, 2006 May 09, 2006
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";
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 09, 2006 May 09, 2006
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 09, 2006 May 09, 2006
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 09, 2006 May 09, 2006
ok, replace this

/:

by

_parent.

and your error will be gone
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 09, 2006 May 09, 2006
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");
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 09, 2006 May 09, 2006
**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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 09, 2006 May 09, 2006
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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 09, 2006 May 09, 2006
LATEST
you're welcome
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines