1,105,352 Community Members

display image using easeljs

Member Avatar
techyworld
Posting Whiz in Training
242 posts since Sep 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi i'm having problem to display image using easeljs. Can someone help? the code below is not displaying anything.

<!DOCTYPE html>
<html>
<head>
    <script type="text/javascript" src="lib/easeljs-0.5.0.min.js"></script>
    <script>
        var stage;
        var canvas;
        var img;
        function init()
        {
            canvas = document.getElementById("canvas");
            stage = new createjs.Stage(canvas);

            img = new Image();
            img.src="images/test.png";


            stage.addChild(img);
            stage.update(); 
        }



    </script>
</head>
<body onload="init">
    <canvas id="canvas" width="1600" height="800"></canvas>
</body>
</html>
Member Avatar
Taywin
Posting Maven
2,632 posts since Apr 2010
Reputation Points: 134 [?]
Q&As Helped to Solve: 378 [?]
Skill Endorsements: 17 [?]
 
0
 

Line 12, shouldn't it be...

stage = new Stage(canvas);
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article