Create Text Effects in Flash and AS3 (Actionscript 3.0)

Posted by druva | Flash, as3, utils | Thursday 7 January 2010 3:45 pm

Just playing with Text and this is my first version of text effects

This movie requires Flash Player 9

sample 0.1

 

CS4 caretIndex(point position) in textField using action script

Posted by druva | Flash, as3, utils | Wednesday 30 December 2009 6:26 am

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);

}
 

date class using flash action script

Posted by Vineela | Flash, as3, utils | Thursday 1 January 2009 10:45 am

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);
 

restricting which characters a TextInput can accept using flash actionscript

Posted by Vineela | Flash, as3, utils | Sunday 28 December 2008 9:33 am

import fl.controls.TextInput;

function textValid(  ) {
  var field:TextInput = new TextInput(  );
  field.restrict = 'a-z';
  addChild(field);
}

textValid();
 

to restrict the number of characters in TextInput using flash actionscript

Posted by Vineela | Flash, as3, utils | Friday 26 December 2008 5:20 am
import fl.controls.TextInput;

var tI:TextInput = new TextInput();
tI.maxChars = 10;
tI.width = 200;
tI.move(10, 10);
addChild(tI);
 

editable and non-editable textinput using flash actionscript

Posted by Vineela | Flash, Flex, as3, utils | Sunday 14 December 2008 4:53 am
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;
}