Flash Lite 1.x ActionScript Language Reference |
|
|
|
| Flash Lite Global Functions > tellTarget() | |||
Flash Lite 1.0.
tellTarget(target) {statement(s);}
target A string that specifies the target path of the timeline to control.
statement(s) The instructions to execute if the condition evaluates to true.
Function; applies the instructions specified in the statement(s) parameter to the timeline specified in the target parameter. The tellTarget() function is useful for navigation controls. Assign tellTarget() to buttons that stop or start movie clips elsewhere on the Stage. You can also make movie clips go to a particular frame in that clip. For example, you might assign tellTarget() to buttons that stop or start movie clips on the Stage or prompt movie clips to move to a particular frame.
In the following example, tellTarget() controls the ball movie clip instance on the main timeline. Frame 1 of the ball instance is blank and has a stop() function so that it isn't visible on the Stage. When the user presses the 5 key, tellTarget() tells the playhead in ball to go to Frame 2 where the animation starts.
on(keyPress "5") {
tellTarget("ball") {
gotoAndPlay(2);
}
}
|
|
|
|