I got something worth exploring... text fields in MX

Well, we’ve all seen that text fields in MX are now objects which can be targeted directly by name. Likewise, if we break text apart once, we see that each letter is still grouped. My question then is this.

Could you asign each letter a name for reference?

It might be that flash already has some name created for this thing, or it might be necessary to cycle through the text.

a “for…in” loop might be able to be used to get each element inside of a text field.

if so, then it would be pretty simple to take an entire text field and have it shatter all of a sudden, sending out the letters like shards of glass.
Think on my question… I may already have the script to do the second part of that. It would be a very cool effect that could be done dynamicaly on any text field.

of course it may be that you simply cannot get at that text in that manner… but I doubt it. Flash MX seems to be completely object oriented now.

Good observation upuaut! I have not had the time to explore MX in such great detail, but I will try to see if a text field can be broken apart during run-time and shattered.

Cheers!
Kirupa

as far as i know text fields can’t be ‘broken’ during run time. you can simluate this effect by doing the following:
1- set a variable that will be the string you would like to break apart.
2- create an array of numbers that represent the horizontal space that each character takes up.
3- dynamically place text boxes on the stage (using ‘createTextField’). refer to the array of horizontal spaces to figure out the distance between each text field.
4- control the text fields just like you would a movie clip. text fields have _x and _y properties that can be set dynamically!

:slight_smile:
jeremy