Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
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.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
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.
Your file was successfully uploaded.