where do you put that script at on the form?
This Class checks a string value passed to it and returns a true if the string is a valid email address, otherwise it will return false.
The Class checks that there is at least one '.' and one '@'.
If they do exist, it also checks that they are not positioned last in the string.
Very useful for Flash eMail forms...
Stay tuned !Code:package { public class CheckEmail { public function CheckEmail() { } public function initCheck(s:String):Boolean { var x:Number; var t:Number=0; var boo:Boolean=new Boolean(); for(var i:Number=0;ix&&s.charAt(i)=='.'&&s.charAt(s.length-1)!='.') { t++ boo=true break; } else { if(i==s.length-1) { boo=false; break; } } } return boo; } } }
where do you put that script at on the form?
Hi
You can keep it in he same directory of the form's FLA.
Just instanciate it:
and call its initCheck function passing the string you want to check:Code:var check_mail:CheckEmail= new CheckEmail();
Code:trace(check_mail.initCheck(info@brndonparis.com));
do you maybe have a fla file you can give me. my email is info@brandonparis.com.
thanks alot.
actually i would love to give you my fla so you can have a look at it. its driving me crazy. i usualy try to figure it out on my own and i'm always successful but this time I have been working on it for days...i think i have more grey hairs today...actually less hair!!!
Brandon
ok here is the problem. i have this newsletter program called YMLP.com which im using for a client who wants a sign up form on there flash site. unfortunately YMLP company only supply's the code for HTML which you just drop into your html and it works like a charm.
HTML EMAIL SUBMIT FORM SUPPLIED BY YMLP:
so the problem is now that i have to figure out how i can set it up on the flash site so it works! i had no clue so i emailed YMLP if they had flash code. and they siad they dont know much about it but they had a friend make something for me. well basically it seems ok but its missing something:
there is only one input text field "where you type the email" and when you click on it you can see that the variable says "YMLP" there is no instance name.
Now when i click on the submit button and open the actions box this is what i see:
on (release) {
getURL("http://www.ymlp.com/subscribe.php?brandonparis");
}
the "brandonparis" part is my account. so when i do a test movie and fill out my email
it opens the newsletter program and i get an error message that says" you for got to fill out the email address. there must be something in my actions which im doing wrong. can you help me.
I have uploaded the html file: Untitled Document which works great and then i have uploaded the FLAhttp://www.brandonparis.com/upload/YMLP_Flash.fla
& SWF http://www.brandonparis.com/upload/YMLP_Flash.swffor just the form part so you can see for yourself! test the movie and fill out the form and see what happens!
im pretty sure that in teh actions it needs code to tell it to send the field information to YLMP site but im not sure how to:
thanks so much for your help.
Brandon.
ps thanks fot eh quick reply to teh first questions. i think i should have asked this one first!
Hi,
i tried the Flash form.
You need one more field text.
The PHP script you call wants 2 variables: username and email.
I changedwithCode:http://www.ymlp.com/subscribe.php?changethis
but it does not work cos the YMLP wants 2 values: username and email.Code:getURL("http://www.ymlp.com/subscribe.php?"+email_txt.text);
Hey Flep.
thanks for taking a crack at it. i dont feel so alone at this now.
so re: this form. its only supposed to have one field..which is email. and when you fill it out and press send it just gets added to the database. the thing is that html form that i put up above works perfectly so its just trying to make the flash form work like that.
hmmmmm what to do!???
thanks alot for helping me man. if you have pay pal i will gladly give you something for helping me out!
Brandon
Try this one:
Newsletter module
OK I'm not sure why this doesn't work but maybe someone can help me.
First off, I have never heard of a FOR/ELSE loop, also there are too many parenthesis here, they don't match up.
Does this code actually work?
Hi,
it works properly, just call the static method and pass the string you want to check![]()
Bookmarks