Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-29-2003, 12:17 AM   #1
monkeybrainz
Down with pants!
 
monkeybrainz's Avatar
 
Join Date: Aug 2001
Location: NJ
Posts: 123
Default onClipEvent(data) - checking variable from PHP

hey guys i'm really stumped -
in my movie the user submits a form to PHP, which validates the form, and if all's cool it emails me.

i'm trying to give the user a message depending on what PHP returns but am having a miserable time figuring out where that passed variable is...

attached to my movie, view_contact_form, is:
ActionScript Code:
onClipEvent(data){       gotoAndPlay("loadcomplete"); }
inside the movie,view_contact_form, on the frame "loadcomplete" is:
ActionScript Code:
if (message=="m1"){                   // all is ok     play(); } if (message=="m3"){            // invalid email     this.attachMovie("error_box", "error_box5", 25);     this.error_box5._x = -40;     this.error_box5._y = -5;     error_box5.error_msg = "Invalid email address";     stop(); }
to submit the form:
ActionScript Code:
on (release){     if (some error trapping here){     } else {         loadVariables("question.php", this);        } }
message is the variable returned from PHP and appears just fine in the dynamic text box i have sitting on on the view_contact_form timeline after i submit the form, but i can't seem to check it with my "if " statements. i tried putting the
"if (message=="m1...." inside the onClipEvent(data){ but that didn't work either.

any help would really be appreciated!!
i'm using flash 5 btw
monkeybrainz is offline   Reply With Quote
Old 05-29-2003, 12:30 AM   #2
JHallam
Dosed...By Flash!
 
Join Date: Feb 2001
Location: England - Nottm
Posts: 1,192
Send a message via Yahoo to JHallam
Default

Ok, create a function with the .data and stick you variables in and check them...done!
__________________
[ JHallam | FOLIO.root | EMAIL.root
JHallam is offline   Reply With Quote
Old 05-29-2003, 02:38 AM   #3
monkeybrainz
Down with pants!
 
monkeybrainz's Avatar
 
Join Date: Aug 2001
Location: NJ
Posts: 123
Default

hey GRaPHiX_FReaK - that's the odd thing, i can't seem to get at the variable! it appears in the OHHH!!! SOAB!@#$ there was a space at the end of the variable passed from PHP so no wonder it didn't show in the text box
<dolt says>maybe i'll should take up knitting instead</dolt>

thanks anyway
monkeybrainz is offline   Reply With Quote
Old 05-29-2003, 11:43 AM   #4
JHallam
Dosed...By Flash!
 
Join Date: Feb 2001
Location: England - Nottm
Posts: 1,192
Send a message via Yahoo to JHallam
Default

Oh dear oh dear! lol Glad your eagle eye picked the problem!
__________________
[ JHallam | FOLIO.root | EMAIL.root
JHallam is offline   Reply With Quote
Old 05-29-2003, 03:02 PM   #5
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,106
Default

when you have flash read in variables for text files, it is always a good idea to put an '&' at the end of each value to return... it trims off all whitespace for your values.
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 05-29-2003, 03:14 PM   #6
monkeybrainz
Down with pants!
 
monkeybrainz's Avatar
 
Join Date: Aug 2001
Location: NJ
Posts: 123
Default

really?...hmmmmm thanks for the tip! and i also should have used [b]trim()[/]- all form variables passed to the server to keep perplexing problems like that from happening in the first place
monkeybrainz is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:10 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.