1. Home
  2. Computing & Technology
  3. Animation

Deconstructing the Paint Application VII: The Text Tool

By , About.com Guide

5 of 5

Creating the Actual Text Field

Although it seems in reverse order, the last thing that we need to do is create the text field in the onClipEvent (mouseUp) handler, along with setting the value of textexists to true once the cursor is clicked on the canvas while the text tool is active:

if(_root.isactive=="texttool"){
if(_root.textexists==false){
_root.drawing.createTextField("textname",0,35,25,635,500);
_root.drawing.textname.variable="typedtext";
_root.drawing.textname.textColor=_root.txtcolor;
_root.drawing.textname.type="input";
_root.drawing.textname.border=false;
_root.drawing.textname.multiline=true;
_root.drawing.textname.wordWrap=true;
_root.drawing.textname.text="Your default message.”
_root.textexists=true;
}
}

This uses the function createTextField with parameters defined as a string for the name of the text field, the layer, the starting x position, starting y position, width, and height. Mine is set to cover my entire workable canvas area.

Explore Animation
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Animation
  4. Flash Animation Tutorials
  5. Deconstructing the Paint Application VII: The Text Tool

©2009 About.com, a part of The New York Times Company.

All rights reserved.