Question: Maybe I am wrong, I learn Easeljs for a week only.  

The Container has no width and height to set the size. 

I have 2 questions:  

1. is the size of Container, dynamically change with the child.  

2. if question 1 answer is yes, can I add a big bitmap or shape to it, eg. a background image...etc. to control the size of Container?

Answer: 
Just add in a third option in the if/elseif chain:

```
    if (walking) {
        if (anim % 40 >= 30) {
            sprite = Sprite.playerF_2;
        else if (anim % 40 >= 20) {
            sprite = Sprite.playerF_1;
        } else if (anim % 40 >= 10) {
            sprite = Sprite.playerF_2;
        } else {
            sprite = Sprite.playerF_3;
        }
    }

```
Here is how I would do it.

This method scales to as many directions(eg. including diagonals) and frames as you could possibly want without the need for hard coding a massive else if block.

Create an enum to hold your possible directions.

```
enum Direction{
    Forward,
    Backward,
    Left,
    Right       
};

```

Then create an `EnumMap` using a direction as the key and having a value of an array of Sprites

`EnumMap<Direction,Sprite[]> animations = null;`

Then add your frames for each animation to their respective directions

`animations.put(Direction.Forward,new Sprite[]{Sprite.Sprite.playerF,Sprite.playerF_1,Sprite.playerF_2});`

Now to do your draw update function all you have to do is 

```
if(walking){
     sprite = animations.get(dir)[getFrame(anim)];
}

```

Now to handle the decision of what frame to use. Assuming `anim` is some sort of frame counter and you want to update less often than every frame. 

For looping eg. 1,2,3,1,2,3,... animations:

```
int getFrame(int anim){
     return (anim / UPDATE_FREQUENCY) % FRAME_COUNT;
}  

```

or for bouncing animations eg. 1,2,3,2,1,2,3,... keep a variable in your draw section to keep trace of what number frame was drawn and what direction it is currently going.

```
int getFrame(int anim, int frameNum, Boolean incrementDirection){
    int frame;
    if(anim % UPDATE_FREQUENCY == 0){
       if(Math.abs(frameNum) == FRAME_COUNT-1)
                 frameNum = 0-frameNum;
        frameNum ++;
    }
    return frameNum;
}

```

To implement this version the draw code would be changed to 

```
int frame = 1;

if(walking){
     frame = getFrame(anim,frame);
     sprite = animations.get(dir)[Math.abs(frame)];
}

```