setChildIndex and boundaries

I am having an index issue. To fix this one, I think I need some math help or a different pair of eyes :ne:

I am adding movieClips to the stage. I then am able to change the index of each movieClip, by moving some mc’s behind or in front of one another. Prior to uploading these mc’s to my database, I get their index locations. Let’s just pretend we are working with 3 mc’s (even though it could be unlimited). I grab the index of these mc’s, and I get (35, 2, 38). I then send this information to the database. Looking at those numbers, we can tell there are a ton of objects on the stage.

Information is sent to DB, and now I open up a new FLA, ready to get the information.

Now I want to get this information, and add the mc’s to a container, in the same exact order they were in before. Because I am adding them to a fresh container, and there are no other objects within the container, these will obviously be out of bounds (except for the one mc at index “2”). I understand they are out of bounds because unlike when I sent them to the DB, there were tons of objects on the stage. This time, there is only the container, and the 3 mc’s, so their old index of (35, 2, 38) won’t work.

I need a way to make sure they are in the same order as they were before I sent them off. Is there any way for me to do this, considering in this scenario the numChildren will equal “5” in all, making the indices of (35, 2, 38) out of bounds? If I could take the 35 and make it 3, and the 38 and make it 4 for example, so that they are in bounds, but still in the same order.

So yes, I guess that is the key. I want them in bounds, and in the same order :slight_smile: I could create a bunch of blank objects, and add them to my container so that these indices do work, but that is sloppy and uncalled for :D.

Hope that makes sense! :ducky::mummy:

Thanks ahead of time