Skip to content
digi3colin edited this page Jun 26, 2012 · 3 revisions

Welcome to the ASCanvas wiki!
javascript:

var canvas = document.createElement(‘canvas’);
document.body.appendChild(canvas);
var ctx = canvas.getContext(‘2d’);

actionscript:

var canvas:Canvas = new Canvas(“myCanvas”,160,160);
var ctx:Canvas = canvas.getContext(“2d”);

both use same canvas implements

ctx.beginPath();
ctx.arc(75,75,50,0,Math.PI*2,true); // Outer circle
ctx.moveTo(110,75);
ctx.arc(75,75,35,0,Math.PI,false); // Mouth
ctx.moveTo(65,65);
ctx.arc(60,65,5,0,Math.PI*2,true); // Left eye
ctx.moveTo(95,65);
ctx.arc(90,65,5,0,Math.PI*2,true); // Right eye
ctx.stroke();

this project supports flash 10 or later.
please find the flash9 (without Vector) from http://code.google.com/p/ascanvas/

Clone this wiki locally