javascript in animate
Why this does not show in Chrome browser?
Note: I dont want to use createjs // my problem is in pure js
this seems to be not needed in Animate. Why???
//var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
var x1 = 400, x2 = 300, y1 = 300, y2 = 50
ctx.lineWidth = 7;
ctx.beginPath();
ctx.strokeStyle='red';
ctx.moveTo(x1, y1);
ctx.lineTo(x2, y2);
ctx.lineTo(x1, y2);
ctx.lineTo(x2, y1);
ctx.stroke()
ctx.fillStyle = "blue";
ctx.fill();