Hi guys,

This might seem like a simple question, but I just can't seem to figure out whats wrong. Maybe it's because it's past midnight and I'm extremely tired, but either way I'll just post it here.

Let me just explain the situation in a mock setup:


You have a button. When the button is pressed, you call a function that attaches a movieclip inside of a tile (another movieclip). Simple. You then tell this newly attached movieclip that is inside the tile to gotoAndPlay(2);, which is essentially a tween animation.

In this example lets say its the following: you press a button which calls a function. This function attaches a movieclip of a character inside another movieclip which is a tile. You then tell this character movieclip to gotoAndPlay(2); which is of, say, him moving to the right.


Function code:

PHP Code:
moveChar = function(){
    
tileName "b"+charRow+"_"+charCol;
    
    
_root[tileName].attachMovie("char","char",_root[tileName].getNextHighestDepth());    
    
_root[tileName].char.gotoAndPlay(2);
       
charCol ++;

What happens is that although you tell the char movieclip to play from frame two, once attached, it automatically appears on the last frame of the animation.

Weird, I know.

Any thoughts?