AS3 TextEditor Lite

as3 text editor
as3 text editor


AS3 TextEditor Lite is a SWC based component for rich text editor which can be used in Flash applications to be developed using Action Script 3 and Adobe Flash CS3 IDE. This component provides features like:

  • Formatting of characters as Bold, Italic, Underline
  • Hyperlink with color, underline options
  • Search and replace texts
  • Indent, Margin (left and right)
  • Paragraph alignment left, right, justified
  • Making unordered lists
  • Line spacing, Character spacing
  • Adding Image (No Edit)
  • Rich Text View and HTML View (two-color coded)
  • Clipboard features: Select All, Copy, Paste, Remove Formatting
  • Inserting special characters

This is a FREE component. download it from :


15 thoughts on “AS3 TextEditor Lite

  1. Thanks a lot for posting it. I was looking for such a text editor for the ages. Again thanks.

  2. Hi
    I’v been searching for hours to find out how to use this component.
    Can anyone help me? I need to know how to attach this component to a textfield


  3. Hi Samir. Great editor!
    An image manager or Browse button would be great though and a way to add or remove different buttons on the editor. In other words, an easy way to modify it.

  4. Hi Behzad,
    Sample FLA and AS files are attached in the download archive. Please study the these file to understand how you can attach the component to a text field.

    Here is the sample class file

    package {
    import flash.display.MovieClip;
    import flash.text.*;
    import fl.controls.UIScrollBar;
    import fl.controls.*;
    import com.mobilewish.as3texteditorlite.AS3TextEditorLite;

    public class TestSample extends MovieClip {

    public function TestSample() {

    var abc:TextField = new TextField();
    abc.width = 510;
    abc.height = 250;
    abc.x = 15;
    abc.y = 100;
    abc.htmlText=’Welcome to AS3 Rich Text Editor Lite !‘;
    abc.border = true;
    abc.wordWrap = true;
    abc.useRichTextClipboard = true;
    abc.multiline = true;
    abc.type = TextFieldType.INPUT;
    abc.background = true;
    abc.alwaysShowSelection = true;
    abc.backgroundColor = 0xFFFFFF;
    abc.doubleClickEnabled = true;
    abc.alwaysShowSelection = true;

    var scroller:UIScrollBar = new UIScrollBar();
    scroller.x = abc.width+scroller.width;
    scroller.y = abc.y ;
    scroller.scrollTarget = abc;
    scroller.height = abc.height;

    var tt:AS3TextEditorLite = new AS3TextEditorLite();
    tt.x = 15;
    tt.y =15
    tt.input_txt = abc;
    tt.scroller = scroller;
    abc.addEventListener(MouseEvent.MOUSE_UP, tt.handleClick);


    And do not forget to add the component to library of your FLA file along with a UI Scrollbar.

  5. Hi samir and thanks for your great text editor.
    I’m using it with some changes but there is only one issue i wanted to tell you about.

    As you know in rich text editor programs when you move your cursor position, text properties in menus automaticaly change to current text style for example if you have your first paragraph with “arial” font and second paragraph with “verdana” font when you move the cursor from the second paragraph to the first one font list will be changed from verdana to arial.

    I’m not sure if it’s possible to retrieve font style from the text on the cursor position but it would be a completion for your text editor

    Thanks again / you’v done a great job

    and good luck with the rest

  6. I just started using this.
    I think this editor is the best match for the project I am working.

    Could you please show some sample code or AS3TextEditorLite API.
    I want to know how to hide some buttons.

    Thanks you samir.

  7. Samir,
    Thank you for this component! I am new to as3, and my limited experience with as3 is strictly with flex, but I was still able to get this flash component to work thanks to your example class.

    I will note a couple of changes that I made, in case it helps someone else trying to use this excellent component.

    First, I created a new property, public var htmlTextInput, for the class, then I set the value of the abc.htmlText = htmlTextInput

    Next, I made the textField object a property of the class by taking it out of the function, and defining it as a public var.

    Now, in the fla file, I deleted the document class definition in the publish settings, and I can set and retrieve the htmlText of the component with this:

    import TestSample;

    //This could be set using flashvars to obtain data from a database or some such…
    var htmlTextInput:String = ‘Welcome to AS3 Rich Text Editor Lite !‘;

    var Faz:TestSample = new TestSample(htmlTextInput);

    submit.addEventListener(MouseEvent.CLICK, DisplayOutput) //Create a submit button

    function DisplayOutput(event):void
    //create some code to send it to a server side script…

  8. Thanks Samir,
    Worked great.

    Any chance of getting the source code.. ? I’d love to do some customization for my needs. Thanks.


Comments are closed.