[noob] Using setChildIndex to keep an array of items above any other children?
Hi all,
I'm continuing trying to develop my little adventure game (I've used a heck of a lot of event listeners; don't shame me until I become pro).
I have a set of "itemAttach"s (circles generated in the constructor function I plan on using temporarily to "hold" items (other Children) that are found, i.e. setting the X and Y of an item to the X and Y of an itemAttach1, 2, etc.
Thing is, I have various scenes (Children that cover the entire stage) being added and removed that end up hiding the itemAttach's.
Can I use setChildIndex (perhaps when they're being generated through the array) to keep the itemAttach's above any other Child that comes or goes? Would it be better to set any other Child to just go behind the itemAttach's index number?
Any help would be appreciated. Certainly let me know if any other info is needed.
Here the AS and FLA files: https://www.mediafire.com/#is1k9b5mr9t2c
Here's the constructor array:
itemAttachArray = new Array();
for (var i:uint = 0; i<7; i++) {
var itemAttach:ItemAttach = new ItemAttach();
itemAttach.x = 50*i;
itemAttach.y = 400;
addChild(itemAttach);
itemAttachArray.push(itemAttach);
//trace(itemAttachArray);
}
