EDOBE XDOM EM Manual do Utilizador Página 107

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 138
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 106
103
Use motion paths
Last updated 6/15/2014
Script panel viewing options: The script panel that opens when you add a trigger has several options to help you make
viewing the code easier. The top-right options menu has three choices that control what’s displayed.
Show Line Numbers displays sequential numbers next to each line of code so you and other developers that share
the script can pinpoint code.
Font Size controls the display size (Small, Medium, or Large) of the text in the script. The default option is Small.
Include Snippet Comments automatically adds comments to the code that you add from the snippet options on
the right side of the panel.
In addition to these display options, you can click the vertical border that divides the white script area with the menu of
code
snippets to collapse the menu to make more room for your code. Click the divider again to expand the menu.
Minding your syntax
Let’s examine the code that you added in the trigger more closely to learn about JavaScript syntax, or the way words and
punctuation work together. Syntax is the grammar of a programming language.
If you’re unfamiliar with program code or scripting, the JavaScript code that Edge Animate inserts may be challenging
to dec
ipher. However, once you understand the basic syntax, you’ll find it easier to follow a script.
The code that is in your trigger at 10000 milliseconds appears as follows:
sym.play(0);
The first word in the statement is sym. When the statement is on the main Timeline, the word sym represents the
whole Edge Animate composition. Edge Animate is organized around the concept of “symbols,” and the root, or
base-level symbol is the Edge Animate Stage. This root symbol contains all the elements and animations in your
Edge Animate composition—everything on the Stage or Timeline. In JavaScript, when we want to do something,
you first identify the object that you want to control. In this case, since you want to affect the Timeline of your Edge
Animate composition, the first thing that is written in the script is sym.
The dot operator (.) provides a way to access different commands for the object that youve identified (in this case,
sym). Objects can be animations, text, or abstract concepts such as the date or particular data. Objects have
properties, which describe them, and methods, which are the things that they can do. In your trigger, the method
for the sym object is play(). The dot, or period separates the object and its method.
As in English, every open parenthesis must have a corresponding close parenthesis, and the same is true for
JavaScript. If you open something, you must close it. All methods have parentheses. Your method, play(), has an
open and close parenthesis.
Each method can have different arguments in between the parentheses, which provide additional information. The
play() method requires a single argument, which tells Edge Animate at what point in time (in milliseconds) to begin
playing. Methods can have multiple arguments, which are separated by commas.
Some arguments require a number, some may need a name, and others may need the words true or false. Whenever
you’re entering the name of a file or a URL, use single or double quotation marks. Quotation marks distinguish a
String value, which represent a sequence of characters, with other kinds of values.
Vista de página 106
1 2 ... 102 103 104 105 106 107 108 109 110 111 112 ... 137 138

Comentários a estes Manuais

Sem comentários