Home
Username:
Password:
Adobe Flash ActionScript 3.0 for Designers Tutorials

Your First Script / The Actions Panel pt. 1

Subtitles of the Movie

Before we begin writing our scripts let me review the Actions Panel where most of this script work will be done. There are two ways to use scripts with Flash. You can embed the scripts in the fla file or link to the scripts from an external ,.as or ActionScript file. I'll use the Actions Panel here to write scripts that are part of your Flash document; that is, the scripts are embedded in the fla file. Use the Script Window back here. You'll actually just open up a New File, an ActionScript File and then type or paste your script right here into the Script Window. Use the Script Window if you want to write external scripts; that is, scripts or classes that are stored in external files and then either linked to your swf file at runtime or inserted into the Timeline during publishing. You can also use a Text Editor to create an external as file. Now to create scripts embedded in the fla file you'll enter the ActionScript directly here into the Actions Panel. Let's go back here and close our external ActionScript file and now bring up the Actions Panel. Now the Actions Panel consists of three panes. The Actions Toolbox, which groups ActionScript elements by category; arguments, arrays, Booleans, dates, errors - these may not make much sense to you until we've covered more about the components of ActionScript and talk about functions and Booleans, arrays, methods and so on. Below the Actions Toolbox is the Script Navigator which lets you navigate to the various scripts that you have in a particular fla file. I have scripts on Frame 45, 35, 25, 15 and Frame 1 so I can very quickly jump to the locations of those scripts here in my Timeline. And lastly, over here to the right is the Script Pane where you type your ActionScript code or, in your case as beginners, you can also paste your code directly here from other files. Now the Actions Panel has two modes. Regular Mode, which is the default and also notice up here in the upper right-hand corner you have something called Script Assist. This will bring you into Script Assist Mode in which you're prompted for elements needed to create your script, so in this way you don't need to actually remember any syntax. The syntax will be included for you but you won't be able to type in or paste in code in the Script Assist Mode so we'll be mostly working in Regular Mode. So let's go ahead and click on Script Assist and move back into Regular Mode. Now in addition to using ActionScript to add interactivity to your Flash projects you can also employ the use of Behaviors and Components. Both Behaviors and Components let you add code to your files without writing it yourself. Behaviors are prewritten scripts for common tasks such as opening up a URL, playing a sound, or stopping a sound. You can add a Behavior and then easily configure it using the Behaviors Panel under Window, Behaviors, there's a little Plus button in the upper left-hand corner that lets you add Behaviors. If I click on that button however, here in ActionScript 3.0 I'll get this error: This feature is not supported by ActionScript 3.0. To use Behaviors you must target ActionScript 1.0 or 2.0 in the Publish Settings dialog. And since we're just looking at ActionScript 3.0 in this tutorial. I won't be covering anything about Behaviors. Components, on the other hand, are prebuilt movie clips that help you implement complex functionality. They are supported in ActionScript 3.0 as well as ActionScript 2.0. A Component can be a simple user interface control, such as a checkbox, or it could be a complicated control such as a scroll pane. You can customize a Component's functionality as well as its appearance. You can also download additional Components created by third-party developers. You can access the Components that ship with Flash CS3 or CS4, or other versions of Flash using the Window, Components option here. That'll bring up the Component's Panel. I have two sets of Components here: User Interface and Video Components. The User Interface section, notice, has Button components, Checkboxes, Data Grids, Lists, Radio Buttons and so on. The Video Components include a component for controlling FLV Video Playback, Playback Captioning and then a series of Interface Controls for controlling a video - Back button, Caption button, Mute button, Pause button and so on. Components are handy if you can find the right component to do what you want it to do. However, writing your own ActionScript gives you the greatest flexibility and control over your document. Now both the Actions Panel and the Script Window have Toolbars at the top of the windows that give you access to code assistance features that will help you simplify and streamline your coding work in ActionScript. So let me now move on to the next movie and provide you with all of their names, as well as a short description so that I can refer to these tools later on in my presentation.

Tutorial Information

Course: Adobe Flash ActionScript 3.0 for Designers
Author: James Gonzalez
SKU: 34060
ISBN: 1-935320-82-3
Release Date: 2009-11-09
Duration: 9.5 hrs / 101 lessons
Work Files: Yes
Captions: Available on CD and Online University
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available