[ Pobierz całość w formacie PDF ]
.For more information on these terms and their use, see the ActionScriptReference Guide.272 Chapter 12Using the Actions panelThe Actions panel lets you create and edit actions for an object or frame using twodifferent editing modes.You can select prewritten actions from the Toolbox list,drag and drop actions, and use buttons to delete or rearrange actions.In NormalMode you can write actions using parameter (argument) fields that prompt youfor the correct arguments.In Expert Mode you can write and edit actions directlyin a text box, much like writing script with a text editor.For information on choosing Actions panel options and switching betweenediting modes, see the corresponding topics in the ActionScript Reference Guide.To display the Actions panel:Choose Window > Actions.Selecting a frame, button, or movie clip instance makes the Actions panel active.The Actions panel title changes to Object Actions if a button or movie clip isselected, and to Frame Actions if a frame is selected.To select an actions editing mode:1 With the Actions panel displayed, click the arrow in the upper right corner ofthe panel to display the pop-up menu.2 Choose Normal Mode or Expert Mode from the pop-up menu.Each script maintains its own mode.For example, if you script one instance ofa button in Normal Mode and another in Expert Mode, switching between theselected buttons will switch the panel s mode.Creating Interactive Movies 273Using the Actions panel in Normal ModeIn Normal Mode, you create actions by selecting actions from a list on the left sideof the panel, called the Toolbox list.The Toolbox list contains Basic Actions,Actions, Operators, Functions, Properties, and Objects categories.The BasicActions category contains the simplest Flash actions and is available only inNormal Mode.The selected actions are listed on the right side of the panel, in theActions list.You can add, delete, or change the order of action statements; you canalso enter parameters (arguments) for actions in the Parameters pane at thebottom of the panel.In Normal Mode, you use the controls in the Actions panel to delete or changethe order and parameters of statements.These controls are especially useful formanaging frame or button actions that have several statements.Add a statementDelete a statementChange the statement orderParameters paneTo select an action:1 Click an Actions category in the Toolbox to display the actions in that category.2 Double-click an action or drag it to the Actions list on the right.274 Chapter 12To use the Parameters pane:1 Click the triangle in the lower right corner of the Actions panel to display theParameters pane.2 Select the action and enter new values in the parameters text boxes to changeparameters of existing actions.To insert a movie clip target path:1 Click the Target Path button in the lower right corner of the Actions panel todisplay the Insert Target Path dialog box.2 Select a movie clip from the display list.For information on using a target path, see Controlling other movies andmovie clips on page 295.To move a statement up or down the list:1 Select a statement in the Actions list.2 Click the Up or Down Arrow buttons in the Actions panel.To delete an action:1 Select a statement in the Actions list.2 Click the Delete ( ) button.To resize the Toolbox or Actions list, do one of the following:" Drag the vertical splitter bar that appears between the Toolbox and Actions list." Double-click the splitter bar to collapse the Toolbox list; double-click the baragain to redisplay the list." Click the Left or Right Arrow button on the splitter bar to expand orcollapse the list.When the Toolbox list is hidden, you can still access its items using the Add (+)button in the upper left of the Actions panel.Creating Interactive Movies 275Expert ModeIn Expert Mode, you create actions by entering ActionScript into the text box onthe right side of the panel or by selecting actions from the Toolbox list on the left.You edit actions, enter parameters for actions, or delete actions directly in the textbox, much as you would create script in a text editor.Expert Mode lets advanced ActionScript users edit their scripts with a text editor,as they would JavaScript or VBScript.Expert Mode differs from Normal Modein these ways:" Selecting an item in the Add pop-up menu or Toolbox list inserts the item inthe text-editing area at the pointer s position." No parameter text boxes appear." In the button panel, only the Add (+) button works." The Up and Down Arrow buttons remain inactive.Toolbox list Actions listFor more information on using Export Mode, see the topic in the ActionScriptReference Guide.276 Chapter 12Assigning actions to objectsYou can assign an action to a button or a movie clip to make an action executewhen the user clicks a button or rolls the pointer over it, or when the movie cliploads or reaches a certain frame.You assign the action to an instance of the buttonor movie clip; other instances of the symbol aren t affected.For a description ofthe actions you can add, see Using basic actions for navigation and interactionon page 283.When you assign an action to a button or a movie clip, Flash automatically assignsa special action called a handler the On Mouse Event action for buttons or theOn Clip Event action for movie clips [ Pobierz całość w formacie PDF ]