T > tellTarget |  |

tellTarget

telltarget, tell target, deprecated

Availability

Flash Player 3. (Deprecated in Flash 5; use of dot notation and the `with` action is recommended.)

Usage

    tellTarget("target") {
    	statement(s);
    }

Parameters

`target` A string that specifies the target path of the Timeline to be controlled.

`statement(s)` The instructions to execute if the condition evaluates to `true`.

Returns

Nothing.

Description

Action; applies the instructions specified in the `statements` parameter to the Timeline specified in the `target` parameter. The `tellTarget` action 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 jump to a particular frame.

In Flash 5, you can use dot notation instead of the `tellTarget` action. You can use the `with` action to issue multiple actions to the same Timeline. You can use the `with` action to target any object, whereas the `tellTarget` action can only target movie clips.

Example

This `tellTarget` statement controls the movie clip instance `ball` on the main Timeline. Frame 1 of the `ball` instance is blank and has a `stop` action so that it isn't visible on the Stage. When the button with the following action is clicked, `tellTarget` tells the playhead in `ball` to go to frame 2 where the animation starts.

    on(release) {
    	tellTarget("ball") {
    		gotoAndPlay(2);
    	}
    }

The following example uses dot notation to achieve the same results.

    on(release) {
    	ball.gotoAndPlay(2);
    }

If you need to issue multiple commands to the `ball` instance, you can use the `with` action, as in the following statement.

    on(release) {
    	with(ball) {
    		gotoAndPlay(2);
    		_alpha = 15;
    		_xscale = 50;
    		_yscale = 50;
    	}
    }

See also

`with`