PDA

View Full Version : Setting AddChild to be a background



thejoeknows.com
June 27th, 2008, 01:29 PM
when trying to set a movieclip as an addchild, my hero still goes under it instead of walking on it.

i hav tried...


addChild(level.mc.building); //where level.mc is the level and building is its background


and ive tried



hero.mc addChild(level.mc.building); //where hero.mc is the character


in both versions the hero walks under the movieclip

any suggestions?

yaim0310
June 27th, 2008, 02:51 PM
setChildIndex(hero,numChildren);change the index of your child objects... 0 is the back and last number is front. so if you always want your hero to be on top keep his index last. but if you want to have him go behind stuff, say like a tree, set the hero's index after the tree, so the tree is say a 4 so put the hero a 3 or less.

edit: lol oops had my numbers mixed up

Felixz
June 27th, 2008, 04:16 PM
Can you show a graph of Ur clips structure?
Anyway, maybe the simplest solution will be the best
addChild(hero);