Movieclip depth, changing on the fly.
Ls (hi kglad),
Im trying to keep all my movieclips onto 1 layer/mother mc to speed up the flash display engine (as suggested by some adobe guru).
It works. but..
I have these takable items(movieclips) that respawn after a while.
Initially i build the level starting with all the takable items before adding all the players/npc's.
This way the player and npc's walk over the objects if they are not taken.
After an items respawns though, i have to re add them to the main mc and then they appear to be over the npc's and they seem to be moving under a carpet of stuff.
Its a nice 3d effect but totally unwanted in this scenario.
Is there a way to make sure that items are added as child before a certain clip (like the player).
I tried using addchildat but this gives me a index error now and then.
I dont really understand how the depths are worked out by flash.
I was thinking of storing the original depth of an item movieclip and then on restore, addchild at at its old depth.
Or is there a more sensible way?
Also: can two movieclips occupy the same index/depth level? or are the incemented or something?
Highest regards,
Mac