Text Documentation
Author: Alex Uhlmann
Last Modified: 09/23/05 19:47:28
Summary
Text class:
Text Properties:
Text Methods:
version: Documentation not provided.
description:
Easy way to setup textfield movieclips. Besides the examples of the Text class, there are more examples using Text in the class documentation of Sequence and MoveOnCurve.
usage:
var myText:Text = new Text();(MovieClip) Movieclip that contains the textfield.
(TextFormat) Instance of TextFormat object. See Flash docs for further information.
description: returns the textfield instance of a textfield movieclip.
Example 1: outputs by default apContainer_mc location: "_level0.apContainer_mc.apText0_mc.apText0_txt"
var myText:Text = new Text();
txt_mc = myText.setText("Hello World");
trace(myText.getText());
Example 2: You can also send a textfield movieclip as a parameter to output
the containing textfield.
myText.getText(someOtherText_mc)
usage:
myText.getText();
myText.getText(text_mc);
parameters:
returns: TextField
description: create a textfield movieclip. You can easily animate textfield movieclips since they are only textfields inside movieclips. All textfields will be centered inside their movieclip.
Example 1: Create a textfield, positioned at 0,0.
var myText:Text = new Text();
myText.setText("Hello World");
Example 2: create and format a textfield, using an embeded font. Note: you need to
create a font symbol in your library and name the identifier to "arialblack".
var myTF:TextFormat = new TextFormat();
myTF.font = "arialblack";
myTF.color = 0xff0000;
myTF.size = 20;
var myText:Text = new Text();
myText.setText("Hello World", 100, 100, myTF);
Example 3: Same like above, just using the setter properties.
var myTF:TextFormat = new TextFormat();
myTF.font = "arialblack";
myTF.color = 0xff0000;
myTF.size = 20;
var myText:Text = new Text();
myText.style = myTF;
myText.setText("Hello World",100,100);
usage:
myText.setText(txt);
myText.setText(txt, x, y);
myText.setText(txt, x, y, style);
parameters:
returns: MovieClip
description: updates the text inside an already via setText() created textfield movieclip. (like yourTextfield.text = txt)
usage:
myText.updateText(txt);
parameters:
returns: Void.
description: adds a text inside an already via setText() created textfield movieclip. (like yourTextfield.text += txt)
usage:
myText.addText(txt);
parameters:
returns: Void.
description: clears a text inside an already via setText() created textfield movieclip. (like yourTextfield.text = "")
usage:
myText.clearText();
returns: Void.
description: returns a unique ID of the instance. Usefull for associative arrays.
usage: myInstance.getID();
returns: Number
description: returns the name of the class.
usage: myInstance.toString();
returns: String