1. Home
  2. Computing & Technology
  3. Animation

Deconstructing the Paint Application VII: The Text Tool

By , About.com Guide

2 of 5

Setting Font Options on Load

Next we need to set a few basic parameters, inside the movie clip that we use as a controller for all objects in the drawing movie clip. We use the onClipEvent (load) handler that should already exist to define other values when the movie loads:
_root.textexists=false;
_root.base.fontsizebox=15;
_root.base.fontbold=false;
_root.base.fontitalic=false;

First we set a variable determining if text has already been entered on the main canvas yet. The movie loads with no text, so the variable textexists=false. This helps determine the status of our text field, as we’ll be switching it from dynamic to input and back again so that text is not affected by painting motions when the text tool isn’t active.

The other variables represent user input from the control panel regarding font weight and size. This sets the default font size at 15, and makes sure that the variables representing bold and italic font weights are false.

Explore Animation
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. 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.