0

The Textfield’s Alpha Property in AS 3.0

The Textfield’s Alpha Property in AS 3.0 via @largestartist Posted by Jose Cuadra on March 10, 2009 Tags: | Filed Under: References

A common and frustrating issue when creating text fields dynamically is the manipulation of this objects alpha property. Usually you just set it and forget it, but in this case a couple more steps are required. the trick is to set the blending mode of the text fields parent object.

First you will need to import the class used. (Only if you are working in a document class):

import flash.display.BlendMode;

Secondly you have to set the parent objects blend mode to LAYER. (Create that Sprite or MovieClip now if it doesn’t already exist.)

myTextClip.blendMode = BlendMode.LAYER;

Finally the text field has to be added as a child of a Sprite or Movieclip.

myTextClip.addChild(myTextField);

Now you have the ability to change the alpha property of the parent object and see it reflect at run time.

myTextClip.alpha=.5;

Want More? Try These.

Related Articles
Transversing the Display List Correctly
Flash Slideshow in Actionscript 3
ActionScript 2 to 3 Object Properties
From Work Path to Shape Layer
Flash Display Fixes
Access Cascading Styles with JavaScript
Disable Safari’s Textarea Grip
Random Functions
Conditional Shortcut in ActionScript
Random Articles
Access Cascading Styles with JavaScript
JavaScripted Tooltips
Table Behavior without Tables
JavaScriptless Tool Tips
IE Conditional Comments
Font Fight!
Flash Slideshow in Actionscript 3
Funny Superman Shirts
Color Picker
Twitter Highlights of the Week

Leave a Reply