Edit in JSFiddle

// Extract from articles by David Rousset available on http://blogs.msdn.com/davrous 
// Monster.js source code
(function (window) {
    // contentManager is an instance described in ContentMananger.js
    // enableShadows is a boolean indicating if you'd like to enable shadows on each sprite or not
    // x_end, y_end are the size of the canvas/stage where the sprites will be drawn
    function Monster(contentManager, enableShadows, x_end, y_end) {
        this.initialize(contentManager, enableShadows, x_end, y_end);
    }
    Monster.prototype = new createjs.BitmapAnimation();

    // public properties:
    Monster.prototype.IDLEWAITTIME = 40;
    Monster.prototype.bounds = 0; //visual radial size
    Monster.prototype.hit = 0; //average radial disparity

    // constructor:
    Monster.prototype.BitmapAnimation_initialize = Monster.prototype.initialize; //unique to avoid overiding base class

    // variable members to handle the idle state
    // and the time to wait before walking again
    this.isInIdleMode = false;
    this.idleWaitTicker = 0;

    var quaterFrameSize;
    // There is 4 types of monsters available A, B, C, D
    var possibleLetters = "ABCD";

    // function to randomly return a monster of type A, B, C or D
    Monster.prototype.chooseMonsterType = function () {
        var monsterName = "";
        var monsterImage;

        monsterName = "Monster" + possibleLetters.charAt(Math.floor(Math.random() * possibleLetters.length));
        switch (monsterName) {
            case "MonsterA":
                monsterImage = this.contentManager.imgMonsterA;
                break;
            case "MonsterB":
                monsterImage = this.contentManager.imgMonsterB;
                break;
            case "MonsterC":
                monsterImage = this.contentManager.imgMonsterC;
                break;
            case "MonsterD":
                monsterImage = this.contentManager.imgMonsterD;
                break;
        }

        return {
            name: monsterName,
            image: monsterImage
        };
    }

    Monster.prototype.initialize = function (contentManager, enableShadows, x_end, y_end) {
        this.contentManager = contentManager;

        // The sprites will have random X & Y on the canvas
        var randomX = Math.floor(Math.random() * (x_end - 32)) + 32;
        var randomY = Math.floor(Math.random() * (y_end - 64)) + 32;

        var randomMonster = this.chooseMonsterType();
        this.name = randomMonster.monsterName;
        this.x = randomX;
        this.y = randomY;

        var localSpriteSheet = new createjs.SpriteSheet({
            images: [randomMonster.image], //image to use
            frames: {
                width: 64,
                height: 64,
                regX: 32,
                regY: 32
            },
            animations: {
                walk: [0, 9, "walk", 1]
            }
        });

        this.BitmapAnimation_initialize(localSpriteSheet);
        this.x_end = x_end;

        quaterFrameSize = this.spriteSheet.getFrame(0).rect.width / 4;

        // start playing the first sequence:
        this.gotoAndPlay("walk"); //animate

        // set up a shadow. Note that shadows are ridiculously expensive. You could display hundreds
        // of animated monster if you disabled the shadow.
        if (enableShadows) {
            this.shadow = new createjs.Shadow("#000", 3, 2, 2);
        }

        // Random number between the -1 or 1 tuple.
        var randomDirection = Math.random() * 2 | 0 || -1;
        // 1 = right & -1 = left
        this.direction = randomDirection;
        this.scaleX = -randomDirection;
        // velocity
        this.vX = 4;
        this.vY = 0;
        // starting directly at the first frame of the walk sequence
        this.currentFrame = 1;
        this.snapToPixel = false;
    }

    Monster.prototype.tick = function () {
        // Hit testing the screen width, otherwise our sprite would disappear
        if (this.x >= this.x_end - (quaterFrameSize + 1)) {
            // We've reached the right side of our screen
            // We need to walk left now to go back to our initial position
            this.direction = -1;
            this.scaleX = 1;
        }

        if (this.x < (quaterFrameSize + 1)) {
            // We've reached the left side of our screen
            // We need to walk right now
            this.direction = 1;
            this.scaleX = -1;
        }

        // Moving the sprite based on the direction & the speed
        this.x += this.vX * this.direction;
        this.y += this.vY * this.direction;
    }

    window.Monster = Monster;
}(window));

// ContentManager.js source code
function ContentManager() {
    // Method called back once all elements
    // have been downloaded
    var ondownloadcompleted;
    // Number of elements to download
    var NUM_ELEMENTS_TO_DOWNLOAD = 4;

    // setting the callback method
    this.SetDownloadCompleted = function (callbackMethod) {
        ondownloadcompleted = callbackMethod;
    };

    // We have 4 type of enemies
    this.imgMonsterA = new Image();
    this.imgMonsterB = new Image();
    this.imgMonsterC = new Image();
    this.imgMonsterD = new Image();

    var numImagesLoaded = 0;

    // public method to launch the download process
    this.StartDownload = function () {
        SetDownloadParameters(this.imgMonsterA, "http://david.blob.core.windows.net/modernhtml5platformer/img/MonsterA.png", handleImageLoad, handleImageError);
        SetDownloadParameters(this.imgMonsterB, "http://david.blob.core.windows.net/modernhtml5platformer/img/MonsterB.png", handleImageLoad, handleImageError);
        SetDownloadParameters(this.imgMonsterC, "http://david.blob.core.windows.net/modernhtml5platformer/img/MonsterC.png", handleImageLoad, handleImageError);
        SetDownloadParameters(this.imgMonsterD, "http://david.blob.core.windows.net/modernhtml5platformer/img/MonsterD.png", handleImageLoad, handleImageError);
    }

    function SetDownloadParameters(imgElement, url, loadedHandler, errorHandler) {
        imgElement.src = url;
        imgElement.onload = loadedHandler;
        imgElement.onerror = errorHandler;
    }

    // our global handler 
    function handleImageLoad(e) {
        numImagesLoaded++

        // If all elements have been downloaded
        if (numImagesLoaded == NUM_ELEMENTS_TO_DOWNLOAD) {
            numImagesLoaded = 0;
            // we're calling back the method set by SetDownloadCompleted
            ondownloadcompleted();
        }
    }

    //called if there is an error loading the image (usually due to a 404)
    function handleImageError(e) {
        console.log("Error Loading Image : " + e.target.src);
    }
}

// main logic to display a fix random number of sprites
var spritesNumber = 10;
var shadowsEnabled = false;
var screen_width;
var screen_height;

function buildFixNumberOfSprites() {
    // Our Monsters collection
    Monsters = new Array();

    for (var xMonsters = 0; xMonsters < spritesNumber; xMonsters++) {
        var newRandomMonster = new Monster(contentManager, shadowsEnabled, screen_width, screen_height);
        Monsters.push(newRandomMonster);
        stage.addChild(newRandomMonster);
    }

    // we want to do some work before we update the canvas,
    // otherwise we could use Ticker.addListener(stage);
    createjs.Ticker.addEventListener("tick", tick);
    // Best Framerate targeted (60 FPS)
    createjs.Ticker.useRAF = true;
};

function tick() {
    // looping inside the Monsters collection
    for (var monster in Monsters) {
        var m = Monsters[monster];
        // Calling explicitly each tick method 
        // to launch the update logic of each monster
        m.tick();
    }

    // update the stage:
    stage.update();
}

// Getting canvas and context
var canvas = document.getElementById("testbench");
canvas.style.backgroundColor = "#607559";
screen_width = canvas.width;
screen_height = canvas.height;
var context = canvas.getContext("2d");

// create a new stage and point it at our canvas:
var stage = new createjs.Stage(canvas);

contentManager = new ContentManager();
contentManager.SetDownloadCompleted(buildFixNumberOfSprites);
contentManager.StartDownload();