Flash Gallery | Flash Templates | Flash Menu | Flash Design | Flash Audio & Video

flash page flip

Actionscript 3.0 video tutorials

+ Reply to Thread
Results 1 to 10 of 10

Thread: CheckEmail Class - Actionscript 3.0

  1. #1
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,457
    Rep Power
    8

    CheckEmail Class - Actionscript 3.0

    amazing Flash templates
    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...
    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;
    		}
    	}
    }
    Stay tuned !

  2. #2
    Junior Member Settled In info@brandonparis.com is on a distinguished road
    Join Date
    Nov 2007
    Posts
    5
    Rep Power
    0

    Re: CheckEmail Class - Actionscript 3.0

    where do you put that script at on the form?

  3. #3
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,457
    Rep Power
    8

    Re: CheckEmail Class - Actionscript 3.0

    Hi

    You can keep it in he same directory of the form's FLA.
    Just instanciate it:
    Code:
    var check_mail:CheckEmail= new CheckEmail();
    and call its initCheck function passing the string you want to check:
    Code:
    trace(check_mail.initCheck(info@brndonparis.com));

  4. #4
    Junior Member Settled In info@brandonparis.com is on a distinguished road
    Join Date
    Nov 2007
    Posts
    5
    Rep Power
    0

    Re: CheckEmail Class - Actionscript 3.0

    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

  5. #5
    Junior Member Settled In info@brandonparis.com is on a distinguished road
    Join Date
    Nov 2007
    Posts
    5
    Rep Power
    0

    Re: CheckEmail Class - Actionscript 3.0

    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:










    Fill out your e-mail address
    to receive our newsletter!



    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!

  6. #6
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,457
    Rep Power
    8

    Re: CheckEmail Class - Actionscript 3.0

    Hi,
    i tried the Flash form.
    You need one more field text.
    The PHP script you call wants 2 variables: username and email.
    I changed
    Code:
    http://www.ymlp.com/subscribe.php?changethis
    with
    Code:
    getURL("http://www.ymlp.com/subscribe.php?"+email_txt.text);
    but it does not work cos the YMLP wants 2 values: username and email.

  7. #7
    Junior Member Settled In info@brandonparis.com is on a distinguished road
    Join Date
    Nov 2007
    Posts
    5
    Rep Power
    0

    Re: CheckEmail Class - Actionscript 3.0

    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

  8. #8
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,457
    Rep Power
    8

    Re: CheckEmail Class - Actionscript 3.0

    Try this one:
    Newsletter module

  9. #9
    Junior Member Settled In justHere is on a distinguished road
    Join Date
    Dec 2007
    Posts
    1
    Rep Power
    0

    Re: CheckEmail Class - Actionscript 3.0

    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?

  10. #10
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,457
    Rep Power
    8

    Re: CheckEmail Class - Actionscript 3.0

    Hi,
    it works properly, just call the static method and pass the string you want to check

+ Reply to Thread

Similar Threads

  1. Replies: 77
    Last Post: 09-01-10, 11:11
  2. Date class of Actionscript 3.0
    By Flep in forum Tutorials
    Replies: 0
    Last Post: 15-10-09, 07:19
  3. Timer class of Actionscript 3.0
    By Flep in forum Tutorials
    Replies: 6
    Last Post: 21-02-09, 00:59
  4. Using PrintJob class of Actionscript 3.0
    By Flep in forum Tutorials
    Replies: 0
    Last Post: 19-11-08, 06:12
  5. Classe CheckEmail
    By Flep in forum Articoli e tutorials
    Replies: 0
    Last Post: 19-09-07, 12:46

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Optimization by vBSEO