Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Adobe Creative Suite

  • Print
  • + Share This
This chapter is from the book

The Actions Panel

The Actions panel is the Flash dialog box that lets you access all the actions that will control your Flash movie. Depending on your level of expertise, you can create, delete, and edit actions in two modes: Normal and Expert. If you're uncomfortable with the ActionScript rules of grammar, the Actions panel can automate some of the scripting process, such as punctuation, generating semicolons and curly braces automatically. The ActionScript panel can also give you real-time code hints as you script and anytime access to the ActionScript reference.

In Flash, the name of the Actions panel appears as either Actions-Frame, Actions-Button, or Actions-Movie Clip, depending on which element you have selected. In any case, the contents of the panel remain the same, so this book always refers to it as the Actions panel.

To open the Actions panel:

  • From the Windows menu, choose Actions (F9).

    or

    Click the right-facing triangle in the Actions bar.

    The Actions panel expands, and the triangle points downward (Figure 3.6).

    Figure 3.6Figure 3.6 Click the arrow in the Actions bar to expand or collapse the Actions panel.

    or

    Alt-double-click (Win) or Option-double-click (Mac) an instance on the Stage or a keyframe in the Timeline.

    The Actions panel appears so that you can attach actions to either the keyframe or the instance.

    or

    Right-click (Win) or Ctrl-Click (Mac) on a keyframe or an instance, and choose Actions in the context menu that appears.

    The Actions panel appears so that you can attach actions to either the keyframe or the instance.

To undock the Actions panel:

  • Drag the Actions panel by the top-left corner marked by the bumpy area.

    Your pointer will change (hand for Mac, arrows for Windows), indicating that you can undock the Actions panel (Figure 3.7).

    Figure 3.7Figure 3.7 The Actions panel can be undocked from the Property inspector (Windows only).

To redock the Actions panel:

  1. Grab the Actions panel by the bumpy area in the left corner, and drag it over the different panels on your desktop.

    Those areas highlight with a bold outline.

  2. Drop the Actions panel.

    The Actions panel docks with the highlighted panels (Figure 3.8). In Mac OS X, the Actions panel cannot dock with the Property Inspector or the Timeline

    Figure 3.8Figure 3.8 You can dock the Actions panel in many places; choose one that suits your own work environment. The Actions panel can be above the Property inspector (top left; the default), above the Timeline (bottom left), to the left or right of the Timeline (right), or among the other panels (bottom).

    TIP

    You can disable docking of all your panels by choosing Edit > Preferences and choosing Disable Panel Docking in the General tab of the Preferences dialog box. (This option is available only on Windows.)

Normal mode

The Normal mode of the Actions panel features several sections and multiple ways to enter ActionScript statements (Figure 3.9). The Actions toolbox on the left side displays all the available commands, organized in logical categories. At the bottom, an index lists all the ActionScript commands in alphabetical order. You choose actions from this categorized list. A brief description of the selected action appears in the top-right section of the Actions panel, and below it, the Parameters pane lets you enter different parameters for that selected action. In the bottom-right section, your completed script appears in the Script pane. At the top of the Actions panel, you can use the pull-down menu to navigate to different scripts within your Flash movie.

Figure 3.9Figure 3.9 The Actions panel in Normal mode.

Expert mode

The Expert mode of the Actions panel is for experienced ActionScript developers who don't need the structured scripting help provided in Normal mode. Expert mode allows you to enter scripts in the Script pane freely, as though you were typing in a text-editing application (Figure 3.10).

Table 3.1

table 1

Figure 3.10Figure 3.10 The Actions panel in Expert mode.

Tips

  • Feel free to switch between Expert and Normal mode. Flash maintains any special formatting you may have used in Expert mode unless you change your script in Normal mode. Then Flash uses its Normal-mode formatting on your script.

  • Switching from Expert to Normal can be an easy way to check for errors. Flash won't allow you to switch from Expert to Normal unless your script is free of errors.

To choose Normal or Expert mode:

  1. With the Actions panel open, click the Options button in the top-right corner.

    The Options pop-up menu appears (Figure 3.11).

    Figure 3.11Figure 3.11 The Options menu in the Actions panel gives you the choice of Normal or Expert mode.

  2. Choose Normal Mode (Cmd-Shift-N for Mac, Ctrl-Shift-N for Windows) or Expert Mode (Cmd-Shift-E for Mac, Ctrl-Shift-E for Windows).

    or

    Click the View Options button (above and to the right of the Script pane), and choose Normal Mode or Expert Mode from the menu (Figure 3.12).

    Figure 3.12Figure 3.12 Choose Normal Mode or Expert Mode from the View Options menu.

To add an action in Normal mode:

  1. Select the instance or frame where you want to assign an action.

    In the Actions toolbox, expand an action category by clicking it.

  2. Double-click the desired action.

    The action appears in the Script pane (Figure 3.13).

    Figure 3.13Figure 3.13 Add an action by choosing a statement from the Actions toolbox. Here, the action stop() has been added to the Script pane.

or

  1. Select the instance or frame where you want to assign an action.

    In the Actions toolbox, expand an action category by clicking it.

  2. Select the action, and drag it into the Script pane (Figure 3.14).

    Figure 3.14Figure 3.14 Add an action by dragging the statement to the Script pane. The pointer changes temporarily to show you where you can drop the action.

    The action appears in the Script pane.

or

  1. Select the instance or frame where you want to assign an action.

  2. Click the plus button above the Script pane, and choose the action from the pull-down menus (Figure 3.15).

    Figure 3.15Figure 3.15 Add an action by choosing it from the plus button's pull-down menus.

    The action appears in the Script pane.

or

  1. Select the instance or frame where you want to assign an action, put your pointer in the Script pane of the Actions panel, and press the Esc key.

  2. Type the two-letter code corresponding to the action you want.

    The action appears in the Script pane.

    For a full list of shortcut-key commands for actions, see Appendix C, or choose View Esc Shortcut Keys from the Actions panel's Options menu (Figure 3.16) to display them in the Actions toolbox.

    Figure 3.16Figure 3.16 Choosing View Esc Shortcut Keys from the Options pull-down menu displays the shortcut keys for every action in the Actions toolbox.

    TIP

    While making your selection in the Actions toolbox, you can use the arrow keys, the Page Up and Page Down keys, or the Home and End keys to navigate through the list. Press Enter or the spacebar to open or close categories or to choose an action to put in the Script pane.

To edit actions in Normal mode:

  • Select the action, and use the up- and down-arrow buttons to rearrange it in the Script pane.

    or

    Select the action, and drag it to its new location (Figure 3.17).

    Figure 3.17Figure 3.17 Move the stopAllSounds () statement by using the arrow buttons (top) or by dragging it to a new location (bottom). A bold horizontal line shows you where the statement will be when you release the mouse button.

  • Select the action, and use the minus button to delete it from the Script pane.

    or

    Select the action, and press the Delete key.

  • Select an action in the Script pane, and use the empty text boxes, check-boxes, and pull-down menus of the Parameters pane to change the parameters for the selected action.

    The Script pane shows the action with the parameters in place (Figure 3.18).

    Figure 3.18Figure 3.18 The Parameters pane lets you change the parameters of a selected action. The Go To action has two parameter text boxes, a pull-down menu, and radio buttons that affect the way it will work. Entering 10 in the Frame text box and selecting the Go to and Play button change the statement in the Script pane, making the playhead go to Frame 10 and begin playing.

    Tips

    • You can still use familiar editing commands such as Copy, Cut, and Paste to create and rearrange ActionScripts. When you paste a copied script, however, the new script appears after the selection rather than replacing it, as a text-editing application would.

    • Use the Shift key to select multiple actions to copy or cut.

    • If you copy or delete one line of a larger code block, the entire code block will be copied or deleted.

      on (release) {
        play();
      }

      If you select just the first line of this code block and press the Delete key, all three lines will be deleted, because the on (release) statement includes the curly braces that span all three lines.

To modify the Actions panel display:

  • Drag or double-click the vertical splitter bar, or click the arrow button that divides the Actions toolbox and Script pane, to collapse or expand an area (Figure 3.19).

    Figure 3.19Figure 3.19 Resizing the Actions panel by dragging (top) or clicking the vertical splitter bar. The Actions toolbox can be resized (middle) or completely collapsed (bottom).

  • In Normal mode, click the triangle in the top-right corner of the Actions panel to collapse or expand the action description (Figure 3.20).

    Figure 3.20Figure 3.20 The black triangle collapses or expands the description of the action.

Actions-panel options

The Actions panel provides many features that can help you write reliable code quickly and easily. Chapter 12 explains many of the debugging tools in detail.

If you're writing ActionScript in Expert mode or entering an expression in a parameters text box in Normal mode, you'll be able to use code hints, which appear as you type. Code hints recognize what kind of action you are typing and offer choices and prompts on how to complete it. Flash makes it easy to be an expert! In Expert mode, you can also customize the format options so that your code looks just the way you want it for ease of reading and understanding.

Regardless of which mode you work in, additional coding help is available in the Actions panel. The Reference button, for example, calls up the Reference panel and sends you directly to the description and usage of any selected action in case you have trouble remembering what a particular action does or how it is used. If you want to keep an ActionScript visible as you select other elements in your Flash movie, you can do so by pinning your script. Pinning makes your script "stick" in the Script pane until you unpin it. This technique is very useful if you've forgotten the name of a text box or a movie clip and need to reference it in an ActionScript statement. You can pin your current script and then go look for your text box or movie clip. Your script remains in place, so that you can make the necessary edits.

To use code hints in Expert mode:

  1. Enter an action in the Script pane by typing the opening parentheses of the action.

    Flash detects the action and anticipates that you will enter its parameters. A code hint appears to guide you (Figure 3.21). If an action has different ways of handling parameters, the tool tip shows those options (Figure 3.22).

    Figure 3.21Figure 3.21 A code hint guides you as you enter ActionScript. The first required parameter for this action is the URL.

    Figure 3.22Figure 3.22 The action gotoAndPlay can be used with one or two parameters. The code hint shows you both ways.

  2. Enter the first parameter and then a comma.

    The bold parameter in the code hint advances to highlight the next required parameter (Figure 3.23).

    Figure 3.23Figure 3.23 After you enter the first parameter, the code hint directs you to the next parameter. The next parameter for this action is the window.

  3. Continue entering the required parameters, and type a closing parenthesis to finish the action.

    The code hint disappears (Figure 3.24).

    Figure 3.24Figure 3.24 When you enter the closing parenthesis, the code hint disappears. The getURL action shown here doesn't require the last parameter (the method).

or

  1. Enter an object target path and then a period.

    Flash anticipates that you will enter a method or property of the particular object that appears before the period. A menu-style code hint appears to guide you (Figure 3.25).

    Figure 3.25Figure 3.25 The code hint provides a scrolling list of methods and properties for each object. This list contains the methods and properties of the Math object.

  2. Choose the appropriate method or property from the menu.

    The method or property appears in the Script pane after your dot. Another code hint appears to guide you, providing the parameters of the method (Figure 3.26).

    Figure 3.26Figure 3.26 The sqrt() method of the Math object requires a number for its parameter.

  3. Enter the parameters of the method, and type a closing parenthesis to finish.

    The code hint disappears (Figure 3.27).

    Figure 3.27Figure 3.27 When you complete the method, the code hint disappears.

    Tips

    • Dismiss a code hint by pressing the Escape key or clicking a different place in your script.

    • Navigate the menu-style code hints by using the arrow keys, the Page Up and Page Down keys, or the Home and End keys. You can also start typing, and the entry that begins with the letter you type will appear in the code hint. Press Enter to choose the selection.

    • You can call up code hints manually by pressing Ctrl-spacebar or by clicking the Show Code Hint button above the Script pane when your pointer is in a spot where code hints are appropriate (Figure 3.28).

      Figure 3.28Figure 3.28 The Show Code Hint button is above the Script pane in Expert mode.

    • Change the delay time for code hints to appear or turn off code hints by choosing Preferences from the Actions panel's Options menu. When the Preferences dialog box appears, change your preferences in the ActionScript Editor tab (Figure 3.29).

      Figure 3.29Figure 3.29 In the Preferences dialog box, you can change the time that it takes for code hints to appear.

To set formatting options in Expert mode:

  1. From the Actions panel's Options menu, choose Auto Format Options.

    The Auto Format Options dialog box appears.

  2. Set the different formatting options and specify the way a typical block of code should appear (Figure 3.30); then click OK

    Figure 3.30Figure 3.30 The AutoFormat options dialog box gives you a preview of how a typical block of code would look with the selections you made..

  3. Choose Auto Format from the Actions panel's Options menu (Ctrl-Shift-F for Windows, Cmd-Shift-F for Mac), or click the Auto Format button above the Script pane.

    Flash formats your script in the Script pane according to the preferences you set in the Auto Format Options dialog box.

To look up actions in the Reference panel:

  • Select an ActionScript term in the Script pane or the Actions toolbox, and click the Reference button above and to the right of the Script pane.

    or

    Right-click (Win) or Ctrl-Click (Mac) an action in the Actions toolbox, and select View Reference from the context menu that appears.

    The Reference panel opens to the selected ActionScript term. The typical entry in the Reference panel contains information about usage and syntax, lists parameters and their availability in various Flash versions, and sample code (Figure 3.31).

    Figure 3.31Figure 3.31 The entry for the gotoAndPlay action in the Reference panel.

To pin or unpin a script in the Script panel:

  • With ActionScript visible in the Script pane, click the Pin Current Script button to the right of the Script pull-down menu (Figure 3.32).

    Figure 3.32Figure 3.32 The Pin Current Script button (top) toggles to Unpin Current Script (bottom).

    To unpin the script, click the button again.

    ActionScript Categories

    You've learned that objects, methods, and properties are essential components of ActionScript. But how do they relate to the categories of actions in the Actions toolbox in the Actions panel, and what are the other categories of actions? Flash organizes actions hierarchically in eight categories, plus an index. These categories are Actions, Operators, Functions, Constants, Properties, Objects, Deprecated, and Flash UI Components. Many contain subcategories of actions. Following is a brief description of the categories.

    • Actions contains the generic commands that control the movie. This category includes actions that manipulate variables (placeholders), expressions (formulas that combine variables), and conditional statements. This category also includes actions that work with movie clips, such as startDrag(mySpaceship). In general, you will be accessing many of the actions in this category to create the interactions between your objects.

    • Operators contains the symbols that transform variables and expressions or compare one value with another. They include the common mathematical symbols, such as the plus and minus sign, and symbols that modify text elements.

    • Functions contains actions, such as getVersion(), that retrieve specific pieces of information. You can think of functions as being input-output machines that return useful information.

    • Constants contains keywords that always signify a certain value. You can use constants, such as true and false, in your expressions.

    • Properties contains the keywords that refer to descriptions of movie clips that you can modify or evaluate. The property _rotation controls the angle of a movie clip, for example.

    • Objects contains all the objects and their unique methods and properties. An example is Selection.getFocus().

    • Deprecated contains the actions that are no longer recommended for use because newer actions have replaced them. These actions are collected in this category if you need to create older Flash content.

    • Flash UI Components contains all the premade interface components provided by Macromedia. Components are specialized movie clips whose contents you can customize. A Component pull-down menu, for example, lets you set the menu's options and its appearance without having to worry about coding its functionality.

    • Index contains all the ActionScript terms in alphabetical order. If you don't know where to find a term, select it in the Index category and right-click (Windows) or Ctrl-click (Mac). In the context menu that appears, choose View Original, and the correct category opens to show the term.

  • + Share This
  • 🔖 Save To Your Account

Peachpit Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Peachpit and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Peachpit products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email ask@peachpit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by Adobe Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.peachpit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020