import flash.events.MouseEvent;
import flash.text.TextFormat;
myText.buttonMode = true;
var myFormat:TextFormat = new TextFormat;
myFormat.size = 24;
myText.setTextFormat(myFormat);
Here myText
is the instance name of the MovieClip of static text. How do I format static text in Flash CS6?
setTextFormat()
is a method of theTextField
class, not of theMovieClip
class. You should call that method on aTextField
, possibly the one in thatMovieClip
, that you namedmyText
.If you are wondering why you do not receive an error for calling a method that doesn't exist on your
MovieClip
: This is becauseMovieClip
is a dynamic class.