tellTarget
Top  Previous  Next


Use this Action to direct all its child Actions to the named Sprite/Movie rather than the current Sprite/Movie.

Panels-Action-TellTarget  

Target
Defines the target the Actions apply to.

The tellTarget Action is useful when you have Sprites or loaded Movies at other levels, as it allows Sprites do things to each other. It also lets the Sprite do things to the main Movie and vice versa.

Note: Sprites that are inside a Button State cannot act as targets, even if they have a name. Also Sprites that are within an unnamed Sprite or a Group can only be referred to from within the Sprite itself (i.e. from one of the Objects inside the Sprite)

Targets can be nested inside other targets. In this case, you need to specify a target by either an absolute or relative target path. Both slash and object synonym notation is supported.

An absolute target path starts with a '/' or _root.
A relative target path starts with either the name of a child Sprite or 'this.<child sprite name>'.
The parent Sprite (or Scene) can be referred to via '../' or '_parent.'.

For example, assume a Scene has the following Sprites:

-Scene 1
   -Sprite Tom
      -Sprite Richard
   -Sprite Harry

Scene 1 contains two Sprites, 'Tom' and 'Harry'. Sprite Tom contains another Sprite, 'Richard'.

From within Sprite Tom, you could use the following to refer to the other Sprites and Scenes:

'/' and _root.refers to Scene 1 (main Movie)  
'../' and _parent.refers to Scene 1 (parent of the current Sprite)  
'../Harry' and _parent.Harryrefers to the sibling Sprite called Harry (that is, Harry is within the parent of Tom)  
'/Harry' and _root.Harryrefers to the Sprite within the main Movie called Harry  
'Richard' and this.Richardrefers to the child Sprite Richard  
'/Tom/Richard' and _root.Tom.Richardrefers to the child sprite Richard, which is a child of Tom, which is in the main Movie.  

In the example below, the tellTarget Action will send "My Sprite" to Frame 1 when Scene_1 arrives at frame 10.

Panels-Action-TellTarget-Example  

This is identical to MySprite.gotoAndPlay(1);