addChildAt for top layer confusion
| //Level 2 |
if (score==10 && score<30 ){
var myMovieClipbg:winbg = new winbg();
myMovieClipbg.x = 0;
myMovieClipbg.y = 5;
addChildAt(myMovieClipbg,1);
}
//level 3
else if (score>30 && score<60){
| var lastmc:tired = new tired(); |
lastmc.x = 0;
lastmc.y = 0;
addChildAt(lastmc, 1);
}
"lastmc" should be top layer background when score is greater than 30 . but its not working . moreover if i use addChild(lastmc) . it becomes top of all layer . so My hero and enemies everything go down. i can not play . but need lastmc just top of myMovieClipbg background layer .
i assume the confusion coming from addChildAt
note addChildAt(myMovieClipbg,1); is working fine for second level. it brings the background top of first background .
but addChildAt(lastmc, 1); is failing to bring the background of of second background
