# Need helps and suggestions in creating lightning particle effect

**URL:** <https://forum.kirupa.com/t/need-helps-and-suggestions-in-creating-lightning-particle-effect/256883>\
**Category:** flash\
**Created:** [April 8, 2008, 1:36pm UTC](https://forum.kirupa.com/t/need-helps-and-suggestions-in-creating-lightning-particle-effect/256883 "2008-04-08T13:36:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ildun](https://avatars.discourse-cdn.com/v4/letter/i/ecccb3/32.png) [@Ildun](https://forum.kirupa.com/u/Ildun)\
**Post date:** [April 8, 2008, 1:36pm UTC](https://forum.kirupa.com/t/need-helps-and-suggestions-in-creating-lightning-particle-effect/256883/1 "2008-04-08T13:36:24Z")

</div>

Currently I am trying to create a lightning and make as a particle effect asset which can export and use in any fla file.

I use for loop to create my particle effect as follow:

thunderbolt = 1;  
for( tb = 0; tb \< thunderbolt; tb++ )  
{  
\_root.thunderorigin.duplicateMovieClip( “thunder”+tb, d++ )  
for( corethunderlifespan = 200; corethunderlifespan \> 0; corethunderlifespan – )  
{  
randomDirection = random(2);

if( randomDirection == 0 )  
{  
\_root[“thunder”+tb].\_x += random(11);  
}

if( randomDirection == 1 )  
{  
\_root[“thunder”+tb].\_x -= random(11);  
}

\_root[“thunder”+tb].\_y += thunderspeed;  
\_root[“thunder”+tb].duplicateMovieClip( “corethunder”+d, d++);  
}  
}

However, I cannot figurte out why I cannot loop the entire for loop. Therefore I only can create one lightning on the screen. When I add one more frame in that layer, it can continuous spawn the lightnings as I wish but it is not reusable.

Can anyone tell me how can I repeat single frame again and again or how to repeat that for loop?
