Hi guys,
I google it and i found similar but not exactly the same issue resolver.
That’s way i’m posting here.
So , Here is scenario:
On the Main time line i have one only keyframe. I the Scene i have only one MovieClip with instance name “currentPlayer_mc”. It is empty initially (or just simple circle not the necessary image).
In the Library I have two other MovieClips:
- girlFront_mc - contains static position person image
- girlWalking_mc - contains a series of keyframes - animated walk (it’s simple).
and finaly i have one container MovieClip that holds those two MovieClips mentioned above (simple again).
This container MovieClips has exported in AcstionScript with Identifier “girlWalk_mc”.
The action layer contains two stop(); at each two keyframes. I labeled this two keyframes as in the image above shown.
The problem!
With the code below i attach the container MovieClip “girlWalk_mc” to the currentPlayer_mc.
When I press the Left arrow key the currentPlayer_mc (with properly attached container girlWalk_mc) moves LEFT.
When I press the Right arrow key the currentPlayer_mc moves RIGHT.
But it doesn’t plays the current MovieClip inside of It e.g. When it is movement (no matter left or right) to play the nested girlWalking_mc. It shows just image of the first keyframe of girlWalking_mc. (its just stops there).
Here is the code:
_global.characterSpeed = 10;
_global.player = “girlwalking_mc”;
_global.initCharacterY:Number;
currentPlayer_mc.attachMovie( _global.player, “crntPlayer_mc”, this.getNextHighestDepth());
_global.initCharacterY = currentPlayer_mc._y;
currentPlayer_mc.onEnterFrame = function():Void{
this.crntPlayer_mc.gotoAndStop(“stopWalk”);
if(Key.isDown(Key.LEFT)){
this.crntPlayer_mc.gotoAndStop(“goWalk”);
this._x -= _global.characterSpeed;
this._xscale = 100;
}
if(Key.isDown(Key.RIGHT)){
this.crntPlayer_mc.gotoAndStop(“goWalk”);
this._x += _global.characterSpeed;
this._xscale = -100;
}
};