Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2011-03-10
2
563 Views
Last Modified: 2012-05-11
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
Comment
Question by:conagraman
2 Comments
 
LVL 5

Accepted Solution

by:
gingermoleman earned 500 total points
ID: 35097915
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
 
LVL 10

Author Closing Comment

by:conagraman
ID: 35100610
that worked like a charm

thanks!
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question