# \[F8\] Assign names in a loop

**URL:** https://forum.kirupa.com/t/f8-assign-names-in-a-loop/286314
**Category:** flash
**Created:** [April 13, 2009, 5:56pm UTC](https://forum.kirupa.com/t/f8-assign-names-in-a-loop/286314 "2009-04-13T17:56:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![capdetrons](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@capdetrons](https://forum.kirupa.com/u/capdetrons)
#### Post date: [April 13, 2009, 5:56pm UTC](https://forum.kirupa.com/t/f8-assign-names-in-a-loop/286314/1 "2009-04-13T17:56:02Z")

</div>

Hello, I’m trying to imitate the spining preloader that fades as it rotates and I can’t remember how to name each of the lines that are created with this code so I can later add the script to modifiy their independent alpha as it turns.

I don’t know wether I need to create another function or what to do…

var numLines:Number = 12;  
var extRadAsterisc:Number = 20;  
var intRadAsterisc:Number = 10;  
var centreX:Number = 110;  
var centreY:Number = 110;

createEmptyMovieClip(“asterisc”, 1);  
asterisc.\_x = centreX;  
asterisc.\_y = centreY;

asterisc.lineStyle(3, 0x000000, 100, false, “none”, “round”);

for (i=0; i\<numLines; i++) {  
angleAsterisc = i_30;  
radAngleAsterisc = angleAsterisc_Math.PI/180;  
xCoord1 = Math.cos(radAngleAsterisc)\*extRadAsterisc;  
yCoord1 = Math.sin(radAngleAsterisc)\*extRadAsterisc;  
xCoord2 = Math.cos(radAngleAsterisc)\*intRadAsterisc;  
yCoord2 = Math.sin(radAngleAsterisc)\*intRadAsterisc;  
asterisc.moveTo(xCoord1, yCoord1);  
asterisc.lineTo(xCoord2, yCoord2);  
}
