Professional Documents
Culture Documents
Symbols (II)
Modify an Instance
We've previously seen that we can modify an instance of a symbol without modifying the original symbol. However, since it is not a vector graphic (we'll see what this means further), we cannot modify the instances with the drawing tools of Flash MX 2004, but with the Properties Panel, that allows the "external" manipulation of the instance. So, this panel, as we've seen, results to be very useful, it does not allow us to modify the basic structure of the instance, but other properties, i.e. we can make the instance to be more bright, but we cannot transform a star into a circle.
In addition, this panel incorporates the button Duplicate Symbol don't want to loss it. We duplicate it and work with the copy.
There are various types of effects. If the symbol has been just created or if it hasn't assigned effect it will appear the tab None. In the next section we'll comment the different effects that are applicable to an instance.
Brightness. You can modify its value measured on a scale from -100% (black) to 100% (white), in other words, completely obscure (black) and completely bright (white). You can move the slider bar or introduce its value directly into the text box.
Tint. This option allows to change the color of the instance, but since, as we said, we cannot modify the instance internally, by varying the color in the tab Tint, the color of all the instance will be changed as we were coloring or setting an imaginary layer of a certain color. We can modify the percentage of the thickness or intensity of this "layer with the first slider, which is on the right.
Alpha. It represents the level of visibility or transparency that this instance will have. It can also be modified by direct value or with the slider bar. It is very useful for animations making objects appear and disappear. If we apply an effect alpha on an instance over another object, the object that before was covered could be seen through the instance.
Advanced. Here we can apply all the previous effects simultaneously in a more precise way, with the advantage that from here we can add a little bit from each one, giving rise to effects of great brightness.
We've applied an Alpha effect of the 65 % and have reduced the green color value to the 45 %
at the same time as we've multiplied the value of blue by 111, obtaining the shown red tint that is observed
While we modify the effects on the instances we could follow the result on the own stage.
Here you can see the way of applying an Alpha transformation to an instance.
What's a graphic?
The Graphics are symbols that allow us to represent static objects and simple animations. In the case we use a graphic symbol to make an animation, we should take into account that it will be bound to the timeline of the movie where it is. In other words, the animation will be played always if the original movie also is reproduced. This causes that, in spite of having its own timeline, it can't contain sounds, controls nor other graphic symbols. So, as a rule we use the graphics for static images or when it's convenient that an animation is played only if determined frame of the movie timeline is under way. Apart of the cases which we've previously commented, where a graphics is not handy, Flash provides us with another type of symbols as we'll see in next units.
Types of Graphics
The graphics can be:
a) Static: this graphic remains without changes. These graphics are typical on the background and on the objects that don't fulfill any special function. The size and consequently the load time of static graphics will be generaly reduced, although it will always depend on the resolution, on its dimensions and on the mode in which they are created.
b) Animated: this type of graphics varies its shape, position and others properties with time. Since to make the animation various graphics beyond the original one should be used or certain actions that can modify the initial state should be made, the size of animated graphics (for the same dimensions and form of creation) will be much more bigger than size of static one.
Because of this, although the animations provide our web more spectacular and attractive appearance, there are two inconveniences: 1) If it's about Bitmaps (now we'll see what it means) the web can arrive at an excessively large size in the end. 2) Although it isn't about bitmaps, for example, if there are typical Flash animations, which size isn't excessive, the setting of many animations can make the visitor a little bit "sick" of our site and therefore his attention from the really important issue: its content.
(*) The previous types of graphics can be, in its turn, of two types, according to the way in which they are created: Vector or Bitmap Graphics. To understand better these two types of graphics, have a look at our basic theme.
Since we've not yet seen the animations in details, we are going to make it in a way that might not be the most appropriate, but it will be very suitable to us for this example. For this select our graphic and press the right button of the mouse. A menu will be opened, in which we'll select the option Edit to modify the graphic and access its timeline. Verify that you are on the timeline of the graphics (there is a sequence just over the stage that shows us in what level we are). On the lower image, it can be noticed that we are on "Scene1 Animated Graphic" and, moreover we are INSIDE of the graphic (and the timeline which we see is the one of the graphic, and not from the main movie).
Let's create now new keyframes by selecting one by one the frames number 2, 3 y 4 and pressing F6 when we select them Press on the frame 2 and change its background color for the oval as we did before. Repeat this in the two following frames.
Press where says Scene 1, which is just above the Stage and we'll turn back to the initial level (Main Movie) and we'll be able to see our graphics "from the outside".
At last we already have our graphics completely animated. What do you think will happen if we play the movie? Let's see it by pressing Control + Enter, the movie will be displayed.
Do you like it? No, we don't at all. The oval continue being the same. But, why? The answer is in the characteristics of the graphics that we had explicated: the timeline of the graphics is bound to one of the movie. In this case the timeline of the movie has only one frame, while the movie of the graphics had 4 frames, therefore, we've not given time for the graphics to develop its animation; it has reproduced only one frame, the first one. How can we solve this? It's very easy. That is enough to recall what we've commented. Close the window of the Flash player, select the frame 5 of the main movie and press F6. Now we have 5 frames in the main movie. Press again Control + Enter.
Yes, now the animation is seen. Save this file, because we'll use it further.
Introducing Bitmaps
A Bitmap file format image can be created with many programs. If you want bitmaps to be in your movies it's more likely that you prefer to create them and to make them more spectacular in another program, more appropriate than Flash for the handling of Bitmaps: Photoshop, Fireworks or Photopaint.
Flash MX 2004 allows us to import bitmaps from other programs, when they have been saved in graphic formats GIF, JPG, tiff and others. It also allows us to modify them in certain way. We can change the size and convert it into a symbol to take advantage of the options provided by Flash. Although, considering what a bitmap is, we will not be able to modify it "internally" but we will be able to use it like one more symbol.
Concretely, the Freehand belongs also to Macromedia, like Flash, so that the compatibility in this case is total.
To understand better how to do this we advise you to do the Exercise Exporting Bitmap.
As we saw in the basic theme there are types of bitmap files that support animations, as the GIF. So, with Flash we can also create an animation and export it like an animated GIF. Nevertheless, as we saw, the animated GIF consists in a sequence of images shown successively and that's why to export a Flash 8 objects like animated GIF it's necessary that all the frames of this animation to be a key frame, because otherwise the GIF will not recognize it and we will not see the desired effect. If you want to know how to do this you should just follow the steps of this clip (Note: it will be used as base of the animated graphics that we created in the paragraph of creating graphics, since the graphics are made frame by frame): On the right we see the Animated GIF that is result of exporting our Flash graphics.
As we've done with the graphics, let's see how the clip timeline isn't bound to the timeline of the document that includes it and at the same time we'll see the difference between the clips and the Graphic symbols that supposes to be one of the reasons for the main use of the formers referring to the animation creations. For it we'll open a new Flash movie ( File New ). Later we'll import any image or create one. We convert it into Symbol (Insert New Symbol...) and we select inBehavior "Movie Clip" We drag it to the stage (if it's not already there) our movie clip. Now we have our Clip inserted in our new Flash document. In other words, we have two movies, each one with its timeline. Now let's see that they are independent, following a similar process to the one we use with the Graphic type symbols.
Observe the timeline of the main movie and verify that it has only one frame.
Let's publish the Clip that we inserted in the document (double click the plain) and examine its timeline. Only one movie clip will appear. We can make something similar to what we made with the graphics, if we are going to create a Movement Animation (that will be seen in Unit 13). It'll look like this
As we see, the duration of the clip that we have inserted is much greater than the new movie that contains it. If the fist were a graphic we already have seen that if we tried to play the movie nothing would happen. Let's see what happens if it is a Clip (this also is valid if the animation was created like the graphics). (Control + Enter). In this case we see the animation because at the moment at which the reproducer has crossed the frame that contained the clip, this one has begun to play and, since its timeline is independent, it has continued in reproducing although the main timeline has finished, and it'll continue in doing it until its own timeline finishes.
Look how to do it When we study the animations we'll see examples of them and we will see the real potential of this type of symbols.
As for all the Clip symbols are stored in the document library when they are created. Its very important because clips are usually very reusable. In order to import movies clips first we must open the library where it is. We've seen in the Symbols unit, two types of libraries: those that are associated with documents or other movies; and the ones that have Flash. So, we can't only use symbols from the same document but also Import them from other documents from our hard disc, in the end it results to be very usefull. Its obvious that the exporting to the library is automatic, because Flash leaves created objects in the library in order to reuse them. To import a Clip from a file on the hard disk we must go to the menu File Import Open External Library, select Flash File (.fla) from which we want to import its library symbols and press Open. The Library will appear with its corresponding list of graphics, buttons and clips from the selected document. It's important to emphasize that when we insert a Clip from a library, all the symbols that it contains, including clips, will be imported as well.. Now we'll show an example in which we will see how to import clips in this way, apart from verifying the clips properties and its independent timelines by the simultaneous reproduction of two movies and creating a quite showy effect by using apparently only one frame.
In order to see how to export and to import a complete movie like one unique clip, and use this for the development in programs like Swish, review our advanced theme: Other uses of the Movie Clips
What's a Button?
The symbols of type Button contribute mostly in the interaction between Flash movies and the user. In Flash, a button is just as any button of any computer environment; Web or any other. They are elements that have to be pressed by the user for triggering a serie of actions. It's also usual to see how this type of elements responds when the mouse passes over them, or they are clicked, for example. Then, to obtain the mentioned interactive effects in other Web oriented languages we must create relatively large programs. This is a quite big disadvantage since the use of buttons is a very common practice in the Internet design. Nevertheless, in Flash it doesn't happen so. Its interface is designed in an special way for the buttons creation, which allows us to easily create all these effects. Similar to the other symbols of Flash MX 2004, the buttons have their own timeline. It is independent, but only four frames composes timeline, one for each possible state of the button.
Up. The aspect of the button by default, in other words, when the mouse pointer is not placed over it nor pressing it. Over. Aspect of the button when we place the pointer over it. Down. Appearance that we want our button to have while we are pressing it. Active area (Hit). Here we must indicate the entire area in which we want our button to respond. This is very important in the composition of buttons, as we will see further on. It seems that the limitation of frames could imply a limitation in the great hit capacity and utility of these symbols, but it isn't so. The buttons can contain in its turn other symbols, like clips or graphics (also of Bitmap type). The sum of the possibilities of all the symbols equips the buttons with great hit.
Creating a button
In the creation of a button we can consider two phases. First we are going to transform an object into a symbol of button type and then we will see how to complete it internally, which will help to us understand its structure better. First of all well create the object that will represent the aspect of our button by designing it with the tools that Flash MX offers us. We'll select the object and access to the menu Insert Convert to Symbol, we'll set the behavior Button and well assign a name to our new symbol.
In this way we've already transformed the object so that it behave like a button. Now well complete it internally. To determine how the button must response to the mouse actions, well edit it by right clicking our new button and selecting the option Edit. When we have the button timeline in front (notice that it has the aspect shown previously), well select each one of the frames (over, up, down and hit) and click F6 to create a keyframe in each one of them.
Now we can modify the initial aspect of the button for each position and set the area of the button action (Hit frame) in which we can just put down the same figure as the initial one (in this case only the object form is important, not the colors or other options) or draw with the Flash draw tools a new figure; our button "will be alluded" on this surface.
This one is a basic button, as well see it can become very complicated, but to start itll be useful. Once we've created the button, if we want to observe its different states without repeating everything, we can do it by accessing to the Library panel of our movie and dragging the button symbol. In order to see what we commented itll be enough to press the key located to the right of the preview of the symbol.
Since now, the buttons have a frame in which we indicate the active area. This seemed to be useless in the examples we saw up to now, since it's active area where we want to have our button is the area that includes the limits of this button.
Let's see that this isn't always so trivial. Here are two buttons created in Flash MX 2004. Let's verify what happens when the mouse moves over one an
Although they seem identical, the difference happens at the moment in which we locate the mouse on one of the spaces that exist between letter and l don't belong to the text itself.
In the left text the button is activated only when we place the mouse pointer over the letter. This can be uncomfortable and can bring to confusion, si pages simply would like to make use of the button and not have to aim concretely some letters that perhaps could be very narrow.
This is due to the poor use of the active area. In the right button this problem is solved as we can verify again. Here you have an example of how to do i
Verify all the states of the mouse. From what the button tells us we can discern that something begins, but perhaps we dont know clearly what. If at certain moment we dont want this to happen on our Web pages, we can introduce a clip in the button, to explain a little more about what will happen if we click.
Here you can follow the process that we commented And that is the result.
Here you have a sample of how to do it. And this is the result:
2) Controlling a movie *** under way. If we are reproducing a Flash movie and we want to allow the user to stop it, start it, play it, and play it back .... For example, to stop a movie we must make our button on the stage of the movie, select it, and open the actions panel, then activate the Stop() function.
After doing this, we would have to change, as we made in the previous animation, the moment at which the function must be executed, selecting the event on Press. We show above how the panel of the button actions would look like. Now whenever we press this button the movie will be stopped. In a similar way we would act doing so but with other control actions.