Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Creating input text fields

From: Creating a First Web Site with Flash Professional CS5

Video: Creating input text fields

When you are going to create a contact form, the first thing you need to do is add some input text fields. So, here I am the sort of last frame of this site and I am just going to double-click on this Contact movie clip. Now, I am inside of this Contact movie clip and here are the fields that I want to be input text fields. So, currently this was actually just imported from the Photoshop, and it brings in this text as editable, which is what I defined when I imported it as TLF Text.

Creating input text fields

When you are going to create a contact form, the first thing you need to do is add some input text fields. So, here I am the sort of last frame of this site and I am just going to double-click on this Contact movie clip. Now, I am inside of this Contact movie clip and here are the fields that I want to be input text fields. So, currently this was actually just imported from the Photoshop, and it brings in this text as editable, which is what I defined when I imported it as TLF Text.

So, that's perfectly fine. Notice that it's set to Selectable. Well, what I want to do is I want to change this to Editable so this is going to give the user the ability to edit this text field. All right, so I've done that, but I also need to adjust it a little further. So, I am just going to use my arrow keys to position this accordingly and then I am going to double-click on it and just expand out this text field, just like that. Then I'll just delete that word John Doe right there. But now again, this is an Editable text field.

I've cleared it out, and it's set up to accept any text the user enters in. I am going to do the same thing for Email. Again, I want to make sure this is Editable. I'll delete the information in there. I'll stretch it out and I am going to use my Selection tool just to kind of reposition it a little bit. Notice as I make them Editable it gives them this dashed line. Okay, so it's just a visual confirmation that I am getting all of this squared away. All right, this text field I am going to change it to Editable as well, and I'll just stretch it out just like that by grabbing that lower right node, and I'll delete that text.

Okay, one thing about this Message text field. I want to make sure that the lines wrap within this text field. So, let's check out some of my options in here as I go into Paragraph and then Container and Flow, these are all my options I get. But under Container and Flow what I have is Behavior. So, I want to make sure this is set to Multiline. Okay, so sometimes it might default to Single Line. Just make sure it's set to Multiline, and then I am ready to go.

Okay, so those are my text fields and also right here what I want this to be is I want this to be like a little feedback text field as well. So, I am going to go ahead and position that off to the side and I am going to make sure this doesn't contain any information whatsoever. So, in general I am slowly getting this set up to receive input. All right, this first text field right here, now that I have it set up, I am going to give it an instance name, and I'll just call it theName and for the Email, I am going to type in theEmail, and then Message is going to be theMessage.

Now, the reason I am adding "the" before each one is that I want to give it a specific name. If I have names that are too general, it might conflict with code within Flash. So, "the" or "my" is sometimes used as well but in general, they have unique instance names now. All right, so let's go ahead and test this out. Control > Test Movie. (Music plays) Contact section and I'll type in like that.

It works great, just like that, just like that. It works out great. One thing I have noticed though is if I am in this Name text field and I hit Tab, you sometimes might run into this issue. You want to give the user the ability to tab through all of these input text fields. But if I hit Tab, what Flash does is it just kind of refers to any button or any interactive object on the Stage starting at the upper left-hand corner.

So, I basically want to define the tab order. All right, that's the code I am going to add, so I'll close this file and right in here, again I am in this Contact movie clip. I am going to create a new layer, and I am going to call it Actions. I am going to select that first frame, and I am going to open up the Actions panel. All right, so I am just going to write some ActionScript from scratch. I'd basically need to add the tab index or the tab order of my text fields.

So, I am going to type in InteractiveObject because that text field is an InteractiveObject, and then just call it theName. That's the first text field, and I am just getting that text area. That's all I am doing is defining that one text field that's actually defined as theName. So, I've basically pointed to that object and I am making sure the tabIndex, and this is nice when I start to type in tabIndex.

It recognizes it as a tabIndex and actually gives me that code hinting. So, as soon as that selected, I could just hit Enter and it adds it and I can define this is the first object to tab. All right, so I am going to copy this code and paste it below, because I want to do the same thing for the Email. So, again I am just defining that input text field as an InteractiveObject. It's going to have a tabIndex number of 2. So, it's gong to be the second field that is tabbed to. The last one is theMessage, and I am going to set this tabIndex to 3 as well.

So, now I am going to be able to tab through all three of those and however many fields you have, you can kind of go on as long as you want, but I am going to go ahead and test out this movie. (Music playing) Type in, hit Tab, it goes to that field, like that, Tab, and it works great. So, again using tabIndex is just great way to get around any sort of little issues that you might have.

But other than that it's as simple as selecting any text field, making sure that it's set to Editable, and you are good to go. So, the next step from here is to send this information out.

Show transcript

This video is part of

Image for Creating a First Web Site with Flash Professional CS5
Creating a First Web Site with Flash Professional CS5

34 video lessons · 28189 viewers

Paul Trani
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Creating a First Web Site with Flash Professional CS5.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.