586 Chapter 12: ActionScript Dictionary
Example
The onUpdate function gives the Live Preview movie an opportunity to update its visual
appearance to match the new values of the component parameters. When the user changes a
parameter value in the components Property inspector or Component Parameters panel,
onUpdate is invoked. The onUpdate function will do something to update itself. For instance, if
the component includes a
color parameter, the onUpdate function might alter the color of a
movie clip inside the Live Preview to reflect the new parameter value. In addition, it might store
the new color in an internal variable.
Here is an example of using the
onUpdate function to pass parameter values through an empty
movie clip in the Live Preview movie. Suppose you have a labeled button component with a
variable
labelColor, which specifies the color of the text label color. The following code is in the
first frame of the main Timeline of the component movie:
//Define the textColor parameter variable to specify the color of the button
label text.
buttonLabel.textColor = labelColor;
In the Live Preview movie, place an empty movie clip named “xch” in the Live Preview movie.
Then place the following code in the first frame of the Live Preview movie. Add “xch” to the
labelColor variable path, to pass the variable through the my_mc movie clip:
//Write an onUpdate function, adding "my_mc." to the parameter variable names:
function onUpdate (){
buttonLabel.textColor = my_mc.labelColor;
}
or
Availability
Flash 4. This operator has been deprecated in favor of the || (logical OR) operator.
Usage
condition1
or condition2
Parameters
condition1,2
An expression that evaluates to true or false.
Returns
Nothing.
Description
Operator; evaluates condition1 and condition2, and if either expression is true, then the
whole expression is true.
See also
|| (logical OR)
, | (bitwise OR)