This is an incredibly frustrating problem for me. I'm an advanced ASer (AS2) and I'm having problems with the most basic function here, attachMovie.
I have a tile-based engine I've been working on. I'm using a gotoAndStop engine to scroll the tiles when the character moves. That's where my problem is.
When I go down and right one tile (scrolling) then scroll up one tile, the far left upper tile doesn't go to the proper frame, but plays the tile movieclip.
I spent an hour using trace functions to figure out what was going on, and I found out that the attachMovie function isn't working for that one tile.
I use a for loop to change tiles.
tiles_mc.attachMovie(tile,name,depth);
trace(tiles_mc[name]);
If I trace this on the second-to-last tile, it returns the movieclip. If I trace this on the last tile, it appends a blank line to the output box - there's the problem. It's not the upper left tile that's screwed up, it's the upper right tile that isn't getting placed on the proper x value because attachMovie is screwing up.
tiles_mc.attachMovie(tile,name,depth);
trace(tiles_mc[name]);
trace(tiles_mc.getInstanceAtDepth(depth));
If I trace those on the last tile, the first trace outputs a blank line, and the second trace outputs the correct movieclip!
What is going on? This is crazy, and I have a deadline I'm trying to meet. I would really appreciate any help you could offer.