Return to Kroll Design home page

Flash Tutorials (with .FLA files included)

 
« Return

ActionScript 2

Bulleted list

This technique can be used to produce bulleted lists that have consistent spacing and which can use a custom bullet that only needs to be changed in one place if it's decided to change the look of the bullet. The biggest disadvantage is the following: since the text is added in ActionScript, you can't see the actual text until you test or publish the movie. It's important to test the movie, to make sure that you correctly chose from a one line, two line, or three line version of the text boxes.

After you've dragged the text boxes onto the stage and have them roughly placed, line them up vertically with the "space" button on the Align panel, not the "distribute" button.

If you'd rather have a whole bunch of library items in order to see the finished text before publishing, do the following: use static text boxes instead of dynamic when creating the 3 "master" bulleted items, then to create each individual bullet in the presentation, use "duplicate" in the library panel to clone items. That could get messy for large presentations, but the ActionScript is going to get messy with the dynamic text version of this, so perhaps there's an even better technique. Using HTML text in Flash is probably your best hope for a better technique than this: the ul and li tags. See if you can specify a custom bullet in a Flash stylesheet -- if you can, that's probably the way to go. But there too, you have the disadvantage of not seeing the completed text until you test or publish.

In this example, the text is 18 pixels per line, but you need extra in order for Flash not to drop/hide a line, so I added 8 extra pixels to the total height of each. So, for the 1-line text box it was 18+8=26, for the 2-line text box it was (18*2)+8=44, and for the 3-line text box it was (18*3)+8=62. These heights are such that I have the text boxes' borders touching each other.

So that you can keep various versions of button ideas in the button movie clip, hide the layers you don't want at the moment, and so that they don't publish, uncheck "export hidden layers".

Download the FLA file

text2_mc.myDynamicText.text = "This text was added in ActionScript, to show how it looks.";

text3_mc.myDynamicText.text = "This text was added in ActionScript.";

text6_mc.myDynamicText.text = "This text was added in ActionScript. It's important that the amount of text is not greater than the intended number of lines.";


 
« Return


©2012 Kroll Design    info@KrollDesign.net    781.910.3694
Last modified: 12/31/1969 7:00 PM