# Letter Cycling

**URL:** <https://forum.kirupa.com/t/letter-cycling/245817>\
**Category:** flash\
**Created:** [December 4, 2007, 4:07pm UTC](https://forum.kirupa.com/t/letter-cycling/245817 "2007-12-04T16:07:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pimsme](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@pimsme](https://forum.kirupa.com/u/pimsme)\
**Post date:** [December 4, 2007, 4:07pm UTC](https://forum.kirupa.com/t/letter-cycling/245817/1 "2007-12-04T16:07:06Z")

</div>

I am using the script from the tut in Kirupa about how to letter cycle a word.

[http://www.kirupa.com/developer/flash5/randomlettercycling2.htm](http://www.kirupa.com/developer/flash5/randomlettercycling2.htm)

I have it working but i am trying to create more than one word in seperate text boxes. I have changed MC names and text boxes, but it seems to only cycle in the first box. I even added dummy letters, which works but i am sure this is not the best way.

Can anyone give me a suggestion on how i would approach this problem? Thanks in advance… here is the script:

onClipEvent (load) {  
if (\_name == “main”) {  
name = “PORTFOLIO”;  
for (x=0; x\<name.length; ++x) {  
this.duplicateMovieClip(“let”+x, x);  
\_parent[“let”+x].\_x += x\*10;  
\_parent[“let”+x].endLetter = name.charAt(x);  
}  
\_root.alphabet = “ABCDEFGHIJKLMNOPQRSTUVWXYZ”;  
\_alpha = 0;  
} else {  
cycle = true;  
}  
}  
onClipEvent (enterFrame) {  
if (cycle) {  
if (this.letter == endLetter) {  
++\_root.count;  
cycle = false;  
} else {  
this.letter = \_root.alphabet.charAt(random(\_root.alphabet.length));  
}  
}  
}
