Description
Learn about costumizing the buttons in this Flash Professional 8 advanced training video series.
Transcript
Now, I just like to set this up so that they act like buttons. So, we are going to add a little bit of roll over event handler and a roll our event handler. Since these are just dynamic text fields, we can modify the style since that block small text does not look so great as a button bar right now. So, let us write just a little bit more. Now, I am going to put some of the style features right inside the button since we have already started some script there, it make sense to kind to continue along with that procedure. So, I can edit anyone of these since they are all the same button. We go back into the action script and I will bring up my action script panel and let us just add a couple of things to it. One of the things that I was thinking off was to add a text format object and that would control all the different buttons. So, I will remove the trace statement at the top and let us replace that with a little text format that we can use. Remember, all we learned about declaring and instantiating objects. I will start up with my bar keyword and rename my text format object TF for text format and I guess I will just call it buttons since that is what we are doing, is making a text format for our buttons. We will declare it as a text format object. So I have :textformat and of course I can take advantage of the hint system and it will instantiate it right in the same line by setting it equal to a new text format object. With my new empty text format object called TF button, we just need to add some properties that will stylize it exactly where we want to see it on the screen. So, I am going to use the wit structure so my typing is a little bit easier and remember that is with and we just need to place an object in there, our TF button, close my parenthesis and will open up a set of grouping phrases where we can assign properties. I think I will change the color first. Now, I can use a hexadecimal value for the color that starts with zero X as an identifier for a hex color and then I will just simply need to type in the hex equivalent of white and that is all F’s. F and hexadecimal is the maximum number so to speak. So, if I type 6 F’s in their, that would be two F’s for the maximum red, two F’s for the maximum green and two F’s for the maximum blue. I will set a size and so you really pay attention to that. I am going to make sure we deal with that hear and by putting all of our format elements in one place, we will only need to go to this one place to change it later if we need to. I think 12 would be okay for a size for starters. I would like it to be bold, so, I will take the bold setting and since that is the bullion, we will set it to true. And I will also would like to spread the letters out a little bit. Let us use a format that we have not tried yet. Letter spacing, I think most of you probably tried that in the properties window but this might be our first time with action script. I can just set that equal to a value now. Default letter spacing for a given font is zero. So, if I just put one in here, it will spread the letters apart a little bit and we can always comeback and play with that value if we would like to. Now, I think I would also like to set a font. I am just going to stick with a simple font Verdana, but remember, we have to embed fonts with our dynamic fields and I will probably want to make sure that I make a font library item so that we got that font available in our movie for use. So, let us do all those steps at once. I will just go up to the top here and I will type in font. We will set it equal to Verdana. Now, I should have a font called or reference as Verdana. So, let us take care of that while we re at it. I am going to my library panel, go to the options and new font, and remember that from before. We can just pick out Verdana or actually any other font that you are interested and if you got some nice fonts you want to use for your button styles there. I will just pick out Verdana here and give it a name. For simplicity, I will just call it the same exact name of the font. And I am going