I'm trying to draw a set of sprites with a for loop, and the part I can't figure out is how to use the index on the sprites themselves.
Running that successfully draws 5 sprites but I don't know how to modify them after that, if I try to change properties of this._box it says undefined so they must be under another name.
I tried this._box+i but it didn't work, what's the correct way to add it?
Code:
for (i = 0; i < 5; i++) {
this._box = new Sprite_Button();
if (typeof mbox[i] == 'undefined') {this._box.bitmap = ImageManager.loadPicture('Icon Panel')} else {this._box.bitmap = ImageManager.loadPicture($dataActors[mbox[i]].meta.icon)}
this.addChild(this._box);
this._box.x = 75 + (161 * i);
this._box.y = 300;
}
Running that successfully draws 5 sprites but I don't know how to modify them after that, if I try to change properties of this._box it says undefined so they must be under another name.
I tried this._box+i but it didn't work, what's the correct way to add it?