I've been working with flash and action script for about 2 weeks now. Having a decent c++ background has really helped the learning curve but I'm having some difficulty working with the attachMovie method. Below is a cut of code that isn't working the way I thought it would.
Here's the deal. I'm trying to place 10 movie clips accross the screen in my main movie. Here's the code that I thought would do that.
box is the exported symbol name of the movie clip I'd like to tile accross the top of the screen.Code:function layBoxes(){ for(var i = 0; i < 10; i++){ var boxName = "box" + i; boxArray[i] = attachMovie( "box", boxName, 3, {_x: 40 + 40 * i, _y: 30}); } }
boxArray[10] holds my referances to each box for easier hitTesting.
This is basically being used for a "brickout" type game and these are the boxes I'm planning on hitting.
Now, when I run this code, it displays the last movie I attached (box9) and the rest are missing. Where did they go?? only box9 appears in the debug tool under _level0.box9. There are no removeMovieClip statements in my code so how could they all dissapear?
I've looked for answers in "Actionscript for Flash MX, The definitive Guide" but maybe I'm overlooking somthing. The flash F1 help pages are usually a half-way decent source of info and tid-bits but I couldn't find anything there either.
Thanks in advance for any help you can offer.
-Jason




Bookmarks