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

Creating buttons

From: Creating a First Web Site with Flash Professional CS5

Video: Creating buttons

Buttons are the foundation of most interactivity and Flash makes them easy to create. That's what I want to do here. I am going to scroll up to the top and right here, you notice here is my graphic, and I am just going to go ahead and take this rectangle, and I am going to drag it to the Library, because that enables me to convert it to a symbol. And in this case, I am going to call it generic button. And then I am going to make sure that it's of type Button as well. Click OK and now you can see it in my Library panel there is my generic button.

Creating buttons

Buttons are the foundation of most interactivity and Flash makes them easy to create. That's what I want to do here. I am going to scroll up to the top and right here, you notice here is my graphic, and I am just going to go ahead and take this rectangle, and I am going to drag it to the Library, because that enables me to convert it to a symbol. And in this case, I am going to call it generic button. And then I am going to make sure that it's of type Button as well. Click OK and now you can see it in my Library panel there is my generic button.

In fact, I can start to drag on sort of multiple buttons on to the Stage. I am going to have a home section, about, portfolio, and then a contact. So I'll just scroll over because I want to put one more over here off to the side and this is going to be my Twitter button. So I am going to use my Free Transform tool, and I am just going to hit Q because here it gives me this hint that says hey, hit Q, and you can go ahead and change that to the Free Transform tool and adjust it like that.

So again here is all of my buttons. So far so good, but now that I've created them, what's unique about buttons? How do I modify them? Well, I can take sort of any one of these instances and I can double-click on it. Notice now I am inside of this generic button, okay. In fact, I'll even zoom in closer on that. So here is my generic button, and in my Timeline panel it gives me this Up state, so these are the default states. Again, since this is a button it also gives me this Over state.

So I can do a right-click and insert a keyframe. Okay, in this second keyframe for the color of this rectangle I can change it to red using my Properties panel. I am going to do the same thing for the Down state. I am going to insert a keyframe. So when the user clicks as they press down on their mouse, well, I want to change it to white, just like that. And then there is also the Hit state so I am going to insert a keyframe for that Hit state. You know what I can do again is hit Q, hit that Q key, and I can start to stretch this out because what this Hit frame is is this actually gives me the active area for this button.

So if the user gets close to this button it's going to highlight. Okay, so this is going to be the sort of active area. All right, with this all set up it seems to look pretty good. Well, my next step is to test this out. So, remember I am inside of generic button. Well, I can go back to Scene 1, so this is my sort of main document. What I want to do now is I want to go ahead and test this out. So I am going to go to Control > Text Movie. Go down to Test. Now I can take a look at these buttons. Remember, I dropped on a total of 5, and you can see them light up accordingly.

Everything looks good and again this is my Over state. If I click down, you can see it turn white. And then remember that hit area is larger so even as I get close to that button, it highlights, and that's the same for all of them because all of these are just instances of that one button. So it looks pretty darn good, but it wouldn't be very helpful in navigation if it didn't have any labels. So let's go ahead and add some text labels to this. How I am going to do that is I am going to add another layer. So in my Timeline panel I am going to click New Layer, and I am just going to call this button text, just like that, and I am going to select my Text tool.

So from there I am going to go to my Properties panel just like I have been doing. I'll come in here and set this up. So I do want to make sure this is set to Classic Text. I don't need this heavier sort of framework of text. I just want this to be a simple label, so I'll make sure this is set to Classic Text. I am going to make sure it's of the font family Arial, and I will make sure it's bold, and then the size is going to be about 12 point. So that's what's set up. It's going to be white text to make sure it stands out, and then I can just click on the Stage and start typing in Home.

All right, also note that this does say Static Text, so make sure your settings are all set up like this and it's going to work out just fine for you. All right, so there is my Home label. I'll select the Selection tool, kind of position that down here, and what I can do is - this is a nice little trick - I can hold down the Option+Shift on a Mac, and that duplicates it. Alt+Shift on Windows. But as you can see it will duplicate that item and move it off to the side, therefore I can rename this to About.

So that's just a quick way using my Selection tool to sort of duplicate items. Again, hold down Option+Shift on Mac, Alt+Shift on PC, and you are good to go. So, I'll just do this a couple of times. And then we have Contact, just like that. All right, remember right over here I have this other button, so let's just scroll down because right here I am going to have "follow me on Twitter." So this is going to be sort of an external link, but note that it is set up just like that.

In fact, let's go ahead and fit this all in Window, and you can se all of my buttons. So it's going to zoom in on this. I am not start to sort of adjust this a little more appropriately because these are just like way off, but I can easily just click and drag these over. Hold down the Shift key to constrain it horizontally in this case. I am going to nudge these over a touch, so I am going to just hit the right arrow on my keyboard, select these two, hit the right arrow, and I start to get that sort of little divider line. It really starts to make this look good.

And now I can position these into place. It's kind of like that. And again the power of this is the fact that this text is outside of the button. If this text was baked into the button, in here if you will, as I double-click I would only be able to use it once for the Contact section. But since it's a generic button I can reuse it many, many times. It makes it easy, makes my file size smaller and simpler to update so I'll click back on Scene 1, and there is my Nav.

We'll do one final test and everything looks appropriate. It's perfect. Now really the next steps would be starting to set this up to add some interactivity to it. But again, using and making generic buttons is a very effective way of making navigation.

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 · 28230 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.