Actionscript 3.0: TextField in a MovieClip Target Issue
The Problem
Targeting a MovieClip when a dynamic text box is the only thing in the movie clip.
-
trace(e.target.name);
-
//outputs the text box name and not the movie clip name
The Solution
Target the parent. Technically the dynamic text box is a child of the MovieClip.
-
trace(e.target.parent.name)
-
// outputs the movie clip name
In Action
Tags: ActionScript, ActionScript 3.0, Flash, MovieClip, TextField