Creative Communications

12 March, 2009

Alpha Properties for TextFields in ActionScript 3

Filed under: Creation,Flash / Interactive,Using Experience — Tags: , , , , — Sean Canton @ 11:51 am

Trying to figure out why those damnable TextFields won’t play nicely with your MovieClips? They just don’t respond to simple things, like setting alpha properties. Fear not! There is a solution! And I won’t forget it this time because I’m writing about it… ;)

Gotta embed those fonts! Here’s the Adobe docs. I won’t venture a technical explanation, only that I assume Flash requires the font vector information to translate the text to a shape, and thus, suitable for raw DisplayObject action.

Step 1: Reference the font. Library > Add Font… Be aware of the name you use here, lets say “Arial” for this example.

Step 2: Make the font available for ActionScript. Library > Font > Linkage. Export for ActionScript in first frame.

Step 3: In your ActionScript:
var tt:TextField = new TextField();
var tf:TextFormat = new TextFormat();
tf.font = "Arial";
tf.color = 0x000000;
tt.defaultTextFormat = tf;
tt.text = "test text";
tt.embedFonts = true;
tt.alpha = .5;
addChild(tt);

Something else to note. You have to assign a defaultTextFormat before placing text into the TextField, otherwise, it doesn’t work right. Finicky Flash.

3 June, 2008

How Media-Rich Websites Annoy when they should Engage

Filed under: Excessive Media Consumption,Using Experience,microadvertising — Tags: , — Sean Canton @ 10:20 am

Remember the blink tag? Does it ever seem like you visit a website with so much going on that it’s difficult to concentrate? Today we have animated flash advertisements that strategically place themselves over the content, demanding a cognitive spurt to find the close button and overcome the annoyance. Why is it that advertisers seem to think that by annoying us, or tricking us, that we will find their product interesting and worthwhile?

(more…)

Powered by WordPress