1. Home
  2. Computing & Technology
  3. Animation

ActionScripting Basics: .textColor with Dynamic Text Fields

By , About.com Guide

4 of 4

Next edit to add:

onClipEvent (mouseDown) {
redwidth=getProperty ( _root.red, _width) ;
_root.displayvalue.text=redwidth;
_root.displayvalue.textColor=0x0000FF;
}

This tells Flash that the color should be equal to the value 0x0000FF--or, to put it simply, blue. The text color must be an RGB value written in Flash as 0xRRGGBB; the easiest way to determine your color is to use an HTML hexadecimal value for the RRGGBB. You can find a list of browser-safe HTML color codes here.

Now, when you click the mouse to display the width of the Movie Clip object, the text color will also change.

Demonstration here.

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. ActionScripting Basics: .textColor with Dynamic Text Fields

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

All rights reserved.