banner



How To Access A Script Through The Animator

Getting started with ActionScript

The ActionScript® scripting language lets you add together complex interactivity, playback command, and data brandish to your application. You tin add ActionScript in the authoring environment by using the Deportment console, Script window, or an external editor.

ActionScript follows its own rules of syntax, reserved keywords, and lets yous employ variables to shop and think information. ActionScript includes a big library of built‑in classes that permit yous create objects to perform many useful tasks. For more information on ActionScript, see the following Help titles:

Y'all practice not have to understand every ActionScript element to begin scripting. If you have a clear goal, y'all can start building scripts with uncomplicated actions.

ActionScript and JavaScript are both rooted in the ECMA-262 standard, the international standard for the ECMAScript scripting language. For this reason, developers who are familiar with JavaScript tin can find ActionScript immediately familiar. For more than information about ECMAScript, go to ecma-international.org.

Which version of ActionScript can you lot use?

Animate includes more than one version of ActionScript to see the needs of different kinds of developers and playback hardware. ActionScript 3.0 and ii.0 are not compatible with each other.

  • ActionScript iii.0 executes fast. This version requires more than familiarity with object-oriented programming concepts than the other ActionScript versions. ActionScript 3.0 is fully compliant with the ECMAScript specification, offers better XML processing, an improved event model, and an improved architecture for working with onscreen elements. FLA files that use ActionScript 3.0 cannot include earlier versions of ActionScript.

  • (Deprecated with Breathing but) ActionScript 2.0 is simpler to learn than ActionScript 3.0. Although Flash Histrion runs compiled ActionScript ii.0 code slower than compiled ActionScript 3.0 code, ActionScript ii.0 is still useful for many kinds of projects. ActionScript 2.0 is also useful for the projects that are not computationally intensive. For example, more pattern-oriented content. ActionScript ii.0 is also based on the ECMAScript specification, but is not fully compliant.

  • (Deprecated with Breathing) ActionScript 1.0 is the simplest course of ActionScript, and is still used by some versions of the Adobe Wink Lite Player. ActionScript one.0 and 2.0 can coexist in the same FLA file.

  • (Deprecated with Animate) Flash Calorie-free two.x ActionScript is a subset of ActionScript 2.0 supported by Wink Calorie-free two.x on mobile phones and devices.

  • (Deprecated with Animate) Flash Lite 1.x ActionScript is a subset of ActionScript one.0 supported past Wink Low-cal 1.ten on mobile phones and devices.

Using the ActionScript documentation

Due to multiple versions of ActionScript (2.0 and three.0), and multiple means of incorporating it into your FLA files, there are different means to learn ActionScript.

You can detect description nearly the graphical user interface for working with ActionScript. This interface includes the Deportment panel, Script window, Script Assist mode, Behaviors panel, Output panel, and Compiler Errors console. These topics apply to all versions of ActionScript.

Other ActionScript documentation from Adobe guides you to acquire most the individual versions of ActionScript.

Ways of working with ActionScript

There are several means to work with ActionScript.

  • (Deprecated with Animate) Script Assist mode lets you add ActionScript to your FLA file without writing the code yourself. You lot select actions, and the software presents you with a user-interface for inbound the parameters required for each ane. Learn a little about what functions to use to accomplish specific tasks, but you don't have to learn syntax. Many designers and non-programmers use this manner.

  • (Deprecated with Animate) Behaviors also let you lot add lawmaking to your file without writing it yourself. Behaviors are prewritten scripts for common tasks. You can add together a behavior and and then hands configure it in the Behaviors panel. Behaviors are bachelor merely for ActionScript 2.0 and earlier.

  • Writing your ain ActionScript gives you the greatest flexibility and command over your document. Merely, it requires you to become familiar with the ActionScript language and conventions.

  • Components are prebuilt movie clips that enable you to implement complex functionality. A component can be a elementary user interface command, such as a check box, or it can be a complicated control, such as a scroll pane. You tin customize a component's functionality and appearance, and you tin download components created by other developers. Most components require you to write some ActionScript code of your own to trigger or control a component. For more than information, see Using ActionScript 3.0 Components.

When yous write ActionScript code in the authoring environment, you use the Actions panel or Script window. The Actions console and Script window contain a full-featured code editor that includes lawmaking hinting and coloring, lawmaking formatting, and syntax highlighting features. It also contains debugging, line numbers, give-and-take wrapping, and support for Unicode.

  • Employ the Actions console to write scripts that are part of your Animate certificate (that is, scripts that are embedded in the FLA file). The Actions panel provides features such every bit the Deportment toolbox, which gives yous quick access to the core ActionScript language elements. You become prompts for the elements that require to create scripts.

  • Use the Script window if yous desire to write external scripts—that is, scripts or classes that are stored in external files. (You tin can also use a text editor to create an external Every bit file.) The Script window includes lawmaking-assistance features such every bit lawmaking hinting and coloring, syntax checking, and auto-formatting.

More recommended customs content

The post-obit articles and tutorials provide more detailed information nigh working with ActionScript:

Overview of the Output panel

When you execute any doc type, the Output panel displays information or warning related to operations such every bit document conversions and publish. To display this information, add trace() statements to your lawmaking or use the Listing Objects and List Variables commands.

If y'all use the trace() statement in your scripts, you tin transport specific data to the Output console when the SWF file runs. It includes notes about the status of the SWF file status or the value of an expression.

The Output panel consists of the following carte du jour items:

  • Re-create: Copies all the contents of the Output panel to the clipboard of computer. To copy a selected portion of the output, select the area you desire to copy and then select Copy.
  • Clear: Clears the content of the output panel.
  • Show Output: Displays the content of the output console.
  • Lock: Locks the panel. You can only resize the panel but you cannot move or drag the console.
  • Help: Loadsthe online Help for the output console.
  • Close: Closes the output panel.
  • Close Grouping: Closes the whole panel grouping. You can simultaneously dock multiple panels such as timeline, output console, and compiler errors panel.

To display or hide the output panel, select Window > Output or press F2.

Actions panel

Looking for the Linguistic communication Reference?

To detect reference documentation for a specific ActionScript language element, exercise 1 of the following:

  • Open the ActionScript iii.0 Language Reference, and search for the linguistic communication element.

  • Type the language chemical element in the Actions console, select information technology, then printing F1 (Press F1 immediately).

Learning ActionScript

To learn about writing ActionScript, utilize these resource:

 ActionScript three.0 and 2.0 are not uniform with each other. Cull but one version for each FLA file you create.

Overview of the Actions panel

To create scripts embedded in a FLA file, enter ActionScript directly into the Actions panel (Window > Deportment or press F9).

The Actions panel consists of two panes:

Script pane

Lets yous type ActionScript lawmaking, which is associated with the currently selected frame.

Script navigator

Lists the scripts in your Animate document, and lets you move quickly between them. To view the script in the Script pane, click an item in the Script navigator.

The Actions panel lets you access the code-assistance features that simplify and streamline coding in ActionScript. You can add non-frame specific global and third-party scripts that tin can be applied to the whole animation from within Animate. For more than information, run across Adding Grandlobal and Third-phigh-sounding southwardcripts section in this page.

  • Run Script: Runs the script
  • Pivot Script: Pins the script to the pin tabs of individual scripts in the Script pane and motion them appropriately. This feature is useful if you lot have not organized the code within your FLA file into one key location. Or, it is useful if you are using multiple scripts. You can pin a script to retain the open up location of the code in the Actions panel and toggle between the various open scripts. This characteristic can be useful when debugging.
  • Insert Case Path and Proper name: Helps you set an absolute or relative target path for an action in the script.
  • Find: Information technology finds and replaces text in your script.
  • Format Code: Helps to format the lawmaking.
  • Code Snippets: Opens the Code Snippets panel that displays sample code snippets.
  • Add using magician: Click this push to add deportment using an easy-to-employ wizard without having to write lawmaking.
  • Help:Displays reference data for the ActionScript chemical element that is selected in the Script pane. For instance, if y'all click an import statement and and so click Help, the reference information for import appears in the Help panel.

Using actions code wizard

You can add interactivity to HTML5 compositions with the Add using magician options in Actions panel. Add together using wizard is a simplified user interface to add code to your compositions.

  1. Create an HTML5 canvas certificate and clickWindow > Deportment.

  2. ClickAdd using magician in Actions panel as shown in the following screenshot.

    Actions panel with Add using magician push
  3. Select an action for which you desire to create lawmaking using the code wizard.

    A sample screenshot displaying action code magician options for actions

    In the to a higher place screenshot,Get frame number action is selected and the respective code has been updated in activity window.

    Based on the action type you select, you lot can also choose the corresponding object for which y'all desire to employ the action. You lot can search for specific objects on stage if the object has an instance name. Also, you tin can use the action on the current pick.

    List of objects on which to employ activeness
  4. Click Side by side to cull a triggering event. A set of trigger events are listed in the window based on your activity type and object type choice in previous steps.

    List of triggering events
  5. Choose an advisable trigger consequence followed past its respective triggering objects, if whatever, and clickStop and add push.

You lot can choose the Current Selection option from the carte du jour when yous select an object in the phase and run the actions code wizard. You can also cull the timeline and components actions for the code.

Enhance the interactivity of an Animation

Interactivity is an essential function of an blitheness that boosts the visual feel of the audience. Desire to learn how to introduce actions to the video without any codes? Watch the tutorial at the finish of this example and follow these steps.

  1. In theTimeline, select the action clip.

  2. Click Add using wizard in Deportment pane.

  3. In Electric current Frame, select the following options:

    • Select an action: SelectPlay.
    • Object on which to apply the action : Select the required object.

How to add interactivity to your animations

Watch the video to learn well-nigh more actions similar play, move vertically, and position the object.

Using script window

The Script window lets you create external script files that you lot import into your application. These scripts tin can be ActionScript or Animate JavaScript files.

Yous can too add together Global and Third-party scripts in HTML5 canvas documents. For more information, see Calculation Global and Third-party scripts section in Create and publish HTML5 Sheet documents in Animate

If you accept more than i external file open, filenames are displayed on tabs beyond the summit of the Script window.

In the Script window, you lot tin use PinScript, find and replace, syntax coloring, format code, code hinting and commenting, and lawmaking plummet features. You can also use debug options (ActionScript files only), and give-and-take wrap. The Script window also lets you display line numbers and subconscious characters.

Create an external file in the Script window

  1. Choose an intent of your selection from the tabs at the acme of the screen such equally Grapheme Blitheness, Social, Game, Education, Ads, Spider web, and Advanced. Select the blazon of external file you want to create (ActionScript file or Animate JavaScript file).

Edit an existing file in the Script window

  • To open an existing script, select File > Open, and then open an existing AS file.

  • To edit a script that is already open up, click the document tab that shows the script's name.

The Actions panel let you admission the code-assistance features that simplify and streamline coding in ActionScript.

Find

Finds and replaces text in your script.

Insert Target Path

(Actions panel only) Helps yous prepare an absolute or relative target path for an activeness in the script.

Assist

Displays reference data for the ActionScript chemical element that is selected in the Script pane. For example, if y'all click an import statement and so click Help, the reference information for import appears in the Help panel.

Lawmaking Snippets

Opens the Code Snippets panel that displays sample lawmaking snippets.

Add using wizard

Helps you lot to add code for actions using an interface without having to write code.

Accessing context-sensitive Aid from the Deportment panel

  1. To select an particular for reference, exercise whatever of the following:

    • Select an ActionScript term in the Actions console toolbox pane (on the left side of the Actions panel).

    • Select an ActionScript term in the Actions console in the Script pane.

    • Place the insertion betoken before an ActionScript term in the Actions panel in the Script pane.

  2. To open the Help panel reference page for the selected particular, exercise one of the post-obit:

    • Press F1.

    • Right-click the detail and select View Help.

    • Click Help above the Script pane.

Prepare ActionScript preferences

Whether you lot edit code in the Actions console or the Script window, you can set and modify a single set of preferences.

  1. Select Edit > Preferences (Windows) or Animate > Preferences (Macintosh), then click Code Editor in the Category list.

  2. Fix any of these preferences:

    Automatic Indentation

    When automatic indentation is turned on, the text yous type after an opening parenthesis "(" is automatically indented to the Tab Size setting. This behavior is also applicable when you use opening curly bracket "{".

    Tab Size

    Specifies the number of characters a new line is indented.

    Code Hints

    Enables code hinting in the Script pane.

    Delay

    Specifies the delay (in seconds) before code hints are displayed. The option is deprecated with Animate.

    Font

    Specifies the font used for your script.

    Open/Import

    Specifies the character encoding used when you open up or import ActionScript files.

    Save/Consign

    Specifies the character encoding used when y'all save or export ActionScript files.

    Reload Modified Files

    Specifies what happens when a script file is modified, moved, or deleted. Select Always, Never, or Prompt.

    Ever

    No alarm is displayed, and the file is automatically reloaded.

    Never

    No alarm is displayed, and the file remains in the electric current state.

    Prompt

    (Default) A warning is displayed, and you tin cull whether to reload the file.

    When y'all build applications with external scripts, this preference enables you to avoid overwriting a script. Or avoid publishing the application with older versions of scripts. The warnings let you automatically shut a script and reopen the newer, modified version.

    Syntax Colors

    Specifies code coloring in your scripts.

    ActionScript 3.0 Settings

    These buttons open the ActionScript Settings dialog boxes, where y'all can set source path, library path, and external library path for ActionScript 3.0.

Source: https://helpx.adobe.com/animate/using/actionscript.html

Posted by: restercoorms.blogspot.com

0 Response to "How To Access A Script Through The Animator"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel