# \[Flash8\]for loop question

**URL:** https://forum.kirupa.com/t/flash8-for-loop-question/283517
**Category:** flash
**Created:** [March 7, 2009, 6:15am UTC](https://forum.kirupa.com/t/flash8-for-loop-question/283517 "2009-03-07T06:15:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![asoako](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@asoako](https://forum.kirupa.com/u/asoako)
#### Post date: [March 7, 2009, 6:15am UTC](https://forum.kirupa.com/t/flash8-for-loop-question/283517/1 "2009-03-07T06:15:49Z")

</div>

Please help ☹ Really want to know the script for this one.

How to loop this script:  
here is the basic script of tiles:  
game.Tile0 = function(){ };  
game.Tile0.\_prototype.\_\_proto = game.TileClass.prototype;  
game.Tile0.\_prototype.frame = 1;  
game.Tile1 = function(){ };  
game.Tile1.\_prototype.\_\_proto = game.TileClass.prototype;  
game.Tile1.\_prototype.frame = 2;

so if i have like 50 tiles those 3 lines will be multiplied by 50,  
i want to loop it tried with array but failed ☹

so basically i want to loop it like this:  
var tile\_Num = 50;  
for(var i=0; i\<tile\_Num; ++i){  
var tile\_Name = “TILE”+i;  
game.tile\_Name = function(){ };  
game.tile\_Name.\_prototype.\_\_proto = game.TileClass.prototype;  
game.tile\_Name.\_prototype.frame = 1;  
}

i know there’s something wrong with it and i need help hehe, Thanks in advance 🙂
