Create Text Effects in Flash and AS3 (Actionscript 3.0)
Just playing with Text and this is my first version of text effects
This movie requires Flash Player 9
sample 0.1
Just playing with Text and this is my first version of text effects
sample 0.1
The caretIndex means the index of the point(caret) position.
import fl.controls.TextInput;
import fl.controls.Label;
var textfield:TextField = new TextField();
textfield.x = textfield.y = 100;
textfield.width = textfield.height = 100;
textfield.text = "blog.totusinfo.com";
addChild(textfield);
textfield.addEventListener(MouseEvent.CLICK, caretindex);
function caretindex(event:MouseEvent):void {
var textfield:TextField = TextField(event.target);
var myLabel:Label = new Label();
myLabel.text = "Caret Index";
myLabel.x = 10;
myLabel.y = 10;
addChild(myLabel);
var textInput:TextInput = new TextInput();
textInput.x = 75;
textInput.y = 10;
textInput.text = String(textfield.caretIndex);
addChild(textInput);
}
import fl.controls.TextInput; var my_date:Date = new Date(); var date:String = my_date.toString() var tI:TextInput = new TextInput(); tI.text = date; tI.move(20,20); addChild(tI);
import fl.controls.TextInput;
function textValid( ) {
var field:TextInput = new TextInput( );
field.restrict = 'a-z';
addChild(field);
}
textValid();
import fl.controls.TextInput; var tI:TextInput = new TextInput(); tI.maxChars = 10; tI.width = 200; tI.move(10, 10); addChild(tI);
import fl.controls.CheckBox;
import fl.controls.TextInput;
var cB:CheckBox = new CheckBox();
cB.label = "Edit Text";
cB.addEventListener(Event.CHANGE, cB_edit);
cB.move(10, 5);
addChild(cB);
var tI:TextInput = new TextInput();
tI.editable = false;
tI.move(17, 30);
addChild(tI);
function cB_edit(evt:Event):void {
tI.editable = cB.selected;
}