PDA

View Full Version : Does anyone know how to break apart a word in actionscript


Matsko
03-07-2004, 10:26 PM
does anyone know how to break apart a word in actionscript. The same way as if you rightclicked a word and clicked on breakapart. Once the word is broken apart then how do you assign each letter to be its own instance.

Thanx in advance

hognav2t
03-08-2004, 12:27 AM
once broken apart, select 1 at a time > press F8 &

choose 'graphic'

bassouma86
03-08-2004, 04:46 AM
works like a charm 4 me 2 break apart twice :)

hognav2t
03-08-2004, 09:44 AM
i thought u wanted 2 turn them into their own instances as in

symbols. but yes, b-apart twice will do the trick especially

if u gonna b shape-tweenin those babies . . .

!!~~

Matsko
03-08-2004, 03:36 PM
I didn't mean that.

Here is an example. I have a flash video where you input your name. Then once the name is inputted then the name would be needed to be split up WITH ACTIONSCRIPT. Then after that the splitted letters would be converted into movie clips or instances.

I know that there is a way of doing it, maybe by converting the name into an array. Then each letter as apart of that array (new array = something. Something[1]="letter 1" and so on...)

So does anyone know how to do that?

bassouma86
03-08-2004, 04:32 PM
i think the only way 2 do so is toi have all letters in 26 different movieclips & parse your inouted name & form the name with the movieclips then according to the needed letters.

Matsko
03-08-2004, 05:06 PM
how do you parse

umbrella
03-08-2004, 11:57 PM
try this quick fix: split();

////////////

textArray = tmpText.split("");
for (i=0;i<tmpText.length;i++) {
trace (_root.textArray[i]);
}

///////////

where tmpText is the variable you set from the text entry box. by passing the split function an empty text string ("") it returns every character to a separate element of the array (textArray)

then you can use a for loop to loop through these array elements ..

if you want to turn these into MC's, you could try something like attachMovie clip, attach a movie clip with a text field in it and place each letter in that field as you loop through the for loop. this way you can give each clip an instance name and further control them wit [AS]

peace