I l @ ve RuBoard |
The Actions panel has two different modes. The default mode is Normal mode. In this mode, you cannot directly type scripts character for character. Instead, you must choose from the menu of keywords on the left side of the screen. This is similar to how scripting in Flash 4 worked. It also makes it nearly impossible to make simple mistakes. Tour of the Actions Panel in Normal ModeFigure 2.1 shows the Actions panel in Normal mode. It is a complex window with many items to review. Figure 2.1. The Actions panel can be used in Normal mode (shown here) or Expert mode.
The top of the panel shows a pop-up menu that shows exactly which script you are currently editing. In Figure 2.1, it reads Actions for Frame 1 of Layer Name Layer 1. This is just a fancy way of saying that it is the script on frame 1, layer 1. On the left side of the panel is a list of ActionScript commands, sorted into categories. Click a category to expand it and see the subcategories or commands inside. On the right side of the panel is a large blank space where options appear as you enter various commands and functions. Figure 2.2 shows the Actions panel after you choose to insert the command goto . Notice the Movie Control category has been expanded on the left. The goto command was double-clicked to insert it into the script. Figure 2.2. The Actions panel in Normal mode as it looks after a goto command has been inserted.
At the top-right side of the panel is a short definition of the command goto . Below that is a custom set of options that apply directly to the goto command. It looks like a small form with fields for Scene, Type, and Frame. This is the parameters area for the selected command. It changes depending on what type of ActionScript command is selected. The first option for the goto command is whether it is a Go to and Play or a Go to and Stop command. In this case, a Go to and Play command is selected. Both commands are similar, except that the first stops the movie at the destination frame, and the second takes it to the destination frame and continues moving forward to the next frame. We'll look at these two commands in depth in Hour 5, "Controlling the Flow of the Movie." This command needs some additional information to make it work. Namely, it needs to know what frame you want to jump to. The Scene field indicates which scene the destination frame is in. In this case, it is the current scene. The next field is a pop-up menu that lets you determine how you want to define the destination frame. You could define it by Frame Number, Frame Label, or Expression. We'll look at the other two options later, but for now Frame Number simply means that you will indicate the exact number of the frame, in this case 1. Under all this are two buttons that have a plus (+) symbol and minus ( “) symbol in them. These allow you to quickly insert and delete commands in your script. However, they are rarely used alternate methods for doing this. You can delete commands by just using the Delete or Backspace key. You can insert commands by using the category list on the right side of the panel. Next to the + and “ buttons are other buttons used for various things. You can search or find and replace text in the script. You can add debugging breakpoints. You can switch between Normal and Expert modes. You can also choose to see line numbers listed next to each line of the script. The little up and down arrows to the far right allow you to select the next or previous lines of code. At the bottom-right side of the Actions panel is your script. In Figure 2.2, you can see the one-line script gotoAndPlay(1); . I placed this script there before taking the screenshot. That line is also highlighted by a dark shade of blue. This means that this line is selected. At the bottom of the Actions window, you can see Line 1: gotoAndPlay(1); . This information area tells you what line number you are at and repeats the line for you. CategoriesThe categories on the left side of the Actions panel break up all the ActionScript keywords into organized groups to make them easier for you to find. You are probably curious about what each category contains. We'll go into detail about specific keywords and symbols in later hours. For now, here is a summary:
Sometimes the categorizations in the Actions panel help you find keywords. At other times, they make it harder. For instance, you might think that _x , the horizontal position of a movie clip, might be found under Objects, Movie, MovieClip, Properties. But it is just under the Properties category at the main level. You might think that sqrt would be under Functions, but it is under Objects, Core, Math, Methods. |
I l @ ve RuBoard |