# Lost in code

**URL:** <https://forum.kirupa.com/t/lost-in-code/19204>\
**Category:** Uncategorized\
**Created:** [April 25, 2003, 7:26am UTC](https://forum.kirupa.com/t/lost-in-code/19204 "2003-04-25T07:26:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vdesigns](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@vdesigns](https://forum.kirupa.com/u/vdesigns)\
**Post date:** [April 25, 2003, 7:26am UTC](https://forum.kirupa.com/t/lost-in-code/19204/1 "2003-04-25T07:26:07Z")

</div>

Random Letter Cycling

# I have tried to understand the code can someone explain this code

onClipEvent (load) {  
if (\_name == “main”) {  
name = “DOOM”;//name to be run through and displayed  
for (x=0; x\<name.length; ++x) {//for var x = 0 and untill it is less than the variable nmes length, get the next alphabet

this.duplicateMovieClip(“let”+x, x);//duplicates the “main” movie  
//clip and gives it name let 1 and so on

\_parent[“let”+x].\_x += x\*15;// sets distance between moviclips

\_parent[“let”+x].endLetter = name.charAt(x);//returns number of the character  
//1\> endLetter will hold D

}

//container where alphabets in name are checked  
\_root.alphabet = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ~º«ô»v«ô»º~";

\_alpha = 0;// makes the “main” instancce invinscible

} else {

cycle = true;//continue to cycle  
}  
}

========More Help Here=======  
onClipEvent (enterFrame) {

if (cycle) {

if (this.letter == endLetter) {//endLetter value is transferred to letter

++\_root.count;//wha t does this do

cycle = false;

} else {

this.letter = \_root.alphabet.charAt(random(\_root.alphabet.length));  
}  
}  
}  
========Please explain======
