targetPath( ) Global Function

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
targetPath( ) Global Function Flash 5

the absolute path to a movie or movie clip
targetPath (movieClip)

Arguments

movieClip

A reference to a movie clip object.

Returns

A string representing the path to movieClip in absolute terms, using dot notation (e.g., "_level0.myMovie").

Description

The targetPath( ) function returns a movie clip's reference as a string that describes the absolute path to the clip (identical to the return value of MovieClip.valueOf( )). The targetPath( ) function sometimes is used to compose placement-sensitive code that operates on a movie clip, relative to the timeline upon which the clip resides. To retrieve the slash-notation path to a movie clip (rather than targetPath( )'s dot notation), use MovieClip._target.

Example

If square is a movie clip contained by shapes, which resides on the main timeline of _level0, then inside the shapes clip, the statement:

targetPath(square);

returns:

"_level0.shapes.square"

See Also

MovieClip._target, MovieClip.valueOf( ); "The targetPath( ) function," in Chapter 13



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net