Solved

form checking input email and number values in flash

Posted on 2006-07-14
2
181 Views
Last Modified: 2010-04-03
Hi experts,

As title I would like to know how to check in flash:

1) a text field 'phone' is number or not
2) a text field 'email' has the correct email format or not (with the @ and '.')

Thanks~!
0
Comment
Question by:huang_ck
2 Comments
 
LVL 7

Accepted Solution

by:
furmiga earned 500 total points
ID: 17113367
Hi there!


Answering n.1 - If you want just numbers in your phone text field then just select the range of the characters allowed to be typed in the field. (In the imput text properties, you will find a button named "characters...", hit "Specify Ranges" and then click "Numerals[0..9]..." then hit OK.

Answering n.2 - This is a bit more complicated. You can set any verifications but still you can't prevent from a wrong imput.

on(release) // simple button action
{
    if((email.text.indexOf("@") == -1) or (email.text.charAt(0) == ".") or (email.text.charAt(0) == "@") or (email.text.indexOf(".") == -1))
    {
        trace("Wrong email format.")
    }
}

Here the email field can't start with "." or with"@" and must have both along the string. This is enuf to make you imput an correct email format. Again, this won't prevent users from type "damn_email@verification.com" with im pretty sure doesn't exist :)

Thats it. Anything just gimme a call


Ralph
0
 

Author Comment

by:huang_ck
ID: 17123081
cool thanks~!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now