Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 575
  • Last Modified:

property/way to give instance name to sprites created from array loop

i have some AS3 code that loops through an array creating sprites for each item in the array and places them on the stage. i would like to be able to give a name or something so that I can reference the sprites and  control them. i am hoping there is a way to do this.  is there a sprite property i can set while looping through my array? or another way of doing this?
0
conagraman
Asked:
conagraman
1 Solution
 
gingermolemanCommented:
Hi,

Yes in your loop have

sprite.name="sprite"+a;

where sprite is the name of the created object and a is the loop index

GMM
0
 
conagramanAuthor Commented:
that worked like a charm

thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now