madcat
10-31-2008, 01:30 PM
Hopefully this is easy... I'm still learning.
I am creating a series of dynamic sprites that contain thumbnail images. When you click on one, I need the name 'thumbX' to pop-up so I can use them for other events in other functions. But now with trace(event.target); I only get 'object Thumb1'.
So I'm referencing the class -- pretty much any event.whatever code I try won't give me 'thumb1', or 'thumb2', etc.
Abbreviated code...
// at top of class
private var thumb1:Thumb1 = new Thumb1();
private var thumb2:Thumb2 = new Thumb2();
private var thumb3:Thumb3 = new Thumb3();
thumbs = [thumb1, thumb2, thumb3];
// In a function I create a series of myBox sprites, and add the thumb array to the sprite container
for (var i = 0....
addChild(myBox);
myBox.addChild(thumbs[i]);
myBoxes.push(myBox);
How would I get 'thumbX' with my code? I think all of the relevant info is above.
Thanks for any help on this.
I am creating a series of dynamic sprites that contain thumbnail images. When you click on one, I need the name 'thumbX' to pop-up so I can use them for other events in other functions. But now with trace(event.target); I only get 'object Thumb1'.
So I'm referencing the class -- pretty much any event.whatever code I try won't give me 'thumb1', or 'thumb2', etc.
Abbreviated code...
// at top of class
private var thumb1:Thumb1 = new Thumb1();
private var thumb2:Thumb2 = new Thumb2();
private var thumb3:Thumb3 = new Thumb3();
thumbs = [thumb1, thumb2, thumb3];
// In a function I create a series of myBox sprites, and add the thumb array to the sprite container
for (var i = 0....
addChild(myBox);
myBox.addChild(thumbs[i]);
myBoxes.push(myBox);
How would I get 'thumbX' with my code? I think all of the relevant info is above.
Thanks for any help on this.