PHOTOGRAPHERSONLINEPROOFING.COM

soft spout spill proof - www.photographersonlineproofing.com

Menu


You've used stop actions in previous lessons. A stop action simply stops the movie from continuing; in this case, you'll use it to stop


the movie from continuing to loop once the movie has fully loaded. 1. Select frame 3 in the Actions layer. [View full size image] 2. Press F6 to insert a keyframe. 3. In the Actions panel, type stop(); [View full size image] Using Variables Variables represent data, and their values can change. You'll use the variable fileName to identify the text file that the script should load when a button is clicked. The variable's value will change for each button, so that a different file is loaded each time. About Script Assist Some actions are simple, such as stop actions. But others require parameters, and if you're unfamiliar with ActionScript, you may have difficulty remembering which options are available-or required-for each type of action. Script Assist mode prompts you to add the methods, parameters, or variables related to the action, and then it assembles the information using the correct syntax for you. Script Assist won't write the script for you. You still have to know what you want to do and which variables, methods, or functions to use. However, it can help you put the pieces together coherently, so that you don't have to return to the script multiple times to troubleshoot syntax errors. To use Script Assist, click Script Assist in the Actions panel. Then, double-click an item in the Actions toolbox to add it to the Script pane. The upper section of the Actions panel displays fields and options that are available for that item. Select options and enter values as appropriate for your script. You'll use Script Assist in the following section, as you declare a variable. Declaring a Variable Before you can use a variable, you need to declare it. To declare a variable, you use the var keyword, name the variable, and assign a value to it. You'll use Script Assist to declare the variable fileName with the value content_home.txt. Content_home.txt is the name of the text file ActionScript imports when the movie first runs or when the Home button is clicked. 1. Click Script Assist in the Actions panel to enter Script Assist mode. 2. In the Actions toolbox, click Language Elements > Statements, Keywords & Directives > Definition Keyword. 3. Double-click the var keyword to add it to the Script pane. The Script Assist pane displays three fields: Variables, Type, and Attributes. [View full size image] 4. In the Variables field, type fileName = "content_home.txt" As you type, the proper syntax appears in the Script pane below. [View full size image] 5. Select String from the Type menu. [View full size image] 6. Click Script Assist to exit Script Assist mode. Downloading Data from a URL