0

As I am trying the easeljs javascript library, I've coded a short page in order to print a blue square. Unfortunately, I've tested it under Chromium in Ubuntu 12.04 host : but it does not show anything. Furthermore, the developper console of Chromium has not detected any error :

index.html

<!DOCTYPE html>
<html>   
<head>
<title>Drag'n drop sur un carre</title>
<script src="easeljs-0.5.0.min.js"></script>
<script src="myScript.js"></script>
</head>

<body onload="init()">
<canvas id="mycanvas" width="640" height="480"></canvas>
</body>
</html>

myScript.js

function init(){
    stage = new createjs.Stage(document.getElementById("mycanvas"));

    carre = new createjs.Shape();
    carre.graphics.beginFill(createjs.Graphics.getRGB(0, 0, 255));
    carre.graphics.rect(0, 0, 30, 30);
    carre.x = 70;
    carre.y = 50;
    stage.addChild(carre);
}

So : what's wrong ? Thanks in advance.

(I'm using easeljs 0.5.0)

loloof64
  • 5,252
  • 12
  • 41
  • 78

1 Answers1

2

You need at the very end to have stage.update();

Uncle Iroh
  • 5,748
  • 6
  • 48
  • 61