Now, we have gone on the feel for how to work with movie clips but of course there is going to be lots of other objects that we are going to be dealing with in action script. So, let us take a look at a couple more of these before we close up this lesson. I will get rid of these two panels and let us bring some other elements onto our stage that we can work with. I will press F9 to get rid of our actions panel just for a second and what I would like to work with are couple of things that they may come into most of your Flash presentations and that would be text elements and buttons.
Now, to save us from making a button, I think I will just swipe one from the libraries that are built into the program. We can access this under windows and common libraries, and I actually got a few elements in here that we can just grab a hold of anytime we need to. So, I will just go into the button section of that one. That is going to bring us up a nice little library panel and we have a whole bunch of different buttons that we can choose from. All these folders have different styles of buttons that we can just grab and add to our presentation.
A couple of these classic buttons down in here. These ones are kind of gaudy and we have got big push button graphics that we can use. I think I will grab a red one. Let me just make sure I put that in the right layer, so I am just kind of access my timeline here a little bit and I think we have got some layers here. There we go. We have got a layer for button syntax. So, let me just go at the button’s layer. We can just grab that red button right on out. I will just toss here off the side screen and I need another one. So, let me just grab the yellow one that is right next to it. Now, I can close this panel on up.
Now, these are just standard buttons. They have got actually got some pretty nice graphics in them. So, if we take a look at them up close, just so we know, what we have grabbed. I can double click on that, to see what is going on inside the button file itself and if I just make sure I show all the layers, I will toggle that twice. You can see that the up button looks like the shiny plastic button. The over looks the same but when you press it. You get a little indent in there, so we just get a nice quick easy button set up for us that we can use.
Now for our text, let me just select the text layer and we will make a piece of text that we can use right over here with the text tool. I will put it right down here. Let us say right in the middle of the screen. So, I just use my text tool, we get the text layer set up. I will just drag out the quickly text field I will type the word place holder in it, just so we can see what the text is going to look like.
Now, just like any other text field that you placed inside a Flash movie you can set the font properties. We will set this to Verdana, I think down here and I will set the size up a little bit. And I will just give it some color. But what I also point out or playing around with text properties is static text. It is one of these items that have no name. Now, our basic rule from this lesson on is going to be action script would not be able to do anything with an item unless it has got a name. Lucky for us, that is what dynamic text is.
It is basically a text field with a name. So, you can see we are really dividing our elements on stage into two categories, things that action script can control and things that it cannot. Let me just give this one a name. I usually put “txt” in front of my text fields. Kind of like using “mc” for movie clips and this text field, I will call the “score”.
Now, let us do the same thing to our buttons as well. We just switch over here, I think I want to that just a little bit and I will use my spacebar to access the hand tool. Get over here where my buttons are on the corner of the screen and remember, we do not only want to have our graphics have the capacity to have a name but we are going to actually have to name them in order to access them.
Now for these ones, I am going to use “btn” so I can find my buttons.
Transcription by:
Scribe4you Transcription Services