need help Converting Actionscript to HTML5 in Adobe Animate using random
this is my code for Actionscript:
//for creating a hexagon on click
stage.addEventListener(MouseEvent.CLICK, addHex);
function addHex(e:MouseEvent):void {
var newHex: hex1 = new hex1
var size:int = Math.round(Math.random()*50+10);
this.addChildAt(newHex, 1);
newHex.x= mouseX;
newHex.y= mouseY;
newHex.width= size;
newHex.height= size;
}
How could I convert this to HTML5?
THANK YOU IN ADVANCE
