06/04/2011

Paragraph indenting using ActionScript

 

One of my main roles at work is to create Smart Ads, this involves taking a design and turning it into a working swf. Now I don't use Flash Pro for this or create FLA's, its all done using ActionScript.
The reason for this is our ads need to have a lot of functionality behind them and still be extremely small. A pure ActionScript approach allows us to create complex ads and keep the file size down.

This does lead to me to have to programmatically build layouts and today I had to create a paragraph of text with the first line slightly indented.

To solve this problem I used the 'indent' property of the TextField class. This allows you to set the number of pixels you wish to have the first line of a paragraph indented, which is exactly what I needed.

No comments: