Adobe 12040118 Using Help - Page 204
Interacting with controls: events and event callbacks, type specification i.e., dialog
UPC - 718659361808
View all Adobe 12040118 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 204 highlights
Adobe After Effects Help Using Help Creating User Interface Elements Back 204 ca n cel B t n : Bu tton { text: 'C a n ce l', b ou n d s : [ 2 3 5 , 1 5 , 3 3 5 , 3 5 ] , \ properties:{name:'cancel'} } \ } \ }"; dlg = new Window (alertBuilderResource); The general structure of a window resource specification is a Window type specification (i.e., "dialog"), followed by a set of braces enclosing one or more property definitions. Controls are defined as properties within windows and other containers by specifying the classname of the control in a property definition, with properties of the control enclosed in braces {}, for example: testBtn: Button { text: 'Test' }. Creation properties are specified in a properties property as named properties of an inline object (see example above). The syntax of window resource specification strings is completely described below. Window resource specification syntax The window resource specification syntax is given in BNF (Backus-Naur Form) below: resourceSpec w indowTy peName inlineObject propertiesList propertyDefn propertyName proper t yValue string number inlineArray objectDefn namedObject = '"' w indowTy peName inlineObject '"' = [a modal dialog] = "{" propertiesList "}" = proper t y De fn { "," proper t yDefn } = proper t yName ":" proper t yValue = [a JavaScript property name] = "null" | "true" | "false" | string | number | inlineArray |objectDefn = [a JavaScript string literal] = [any JavaScript integer or real number literal] = "[" proper t y Va lue { "," proper t yVa lue } "]" = ( namedObject | inlineObject ) = [any object classname] inlineObject Note: To create a UI element, the classname in the namedObject definition above can be any element classname referred to in "Types of interface elements" on page 197. For example: "dialog { \ tex t : ' From Re s o u rce', b o u n d s : [ 1 0 , 1 0 , 2 1 0 , 1 1 0 ] , \ box: Panel { \ bounds: [10, 10, 190, 90], \ ok: Button { \ tex t : 'O K ', b o u n d s : [ 4 0 , 3 0 , 1 4 0 , 5 0 }"; Interacting with controls: events and event callbacks When a script creates a window, it typically adds control elements to the window that a user can manipulate, for instance, by clicking a button, entering text in a text box, moving a scrollbar, etc. These user actions or manipulations generate events within the user interface system. The script that creates a window needs a way to be notified of events from that window or from controls within the window. The scripting user interface provides a number of event callback methods that a script can define as properties of any UI element that the script needs to interact with. Using Help Back 204