var stage = acgraph.create("container");
var textObject = layer.text(70, 55, "Click on this TEXT");
textObject.style({fontSize: "18px"});
textObject.selectable(false);
textObject.listen("click", function(e) {
textObject.text("You clicked " + counter + " times. Click again.");
layer.listen("click", function(e) {
textObject.color(getRandomColor());
function getRandomColor() {
red = Math.floor(Math.random() * (max - min)) + min;
green = Math.floor(Math.random() * (max - min)) + min;
blue = Math.floor(Math.random() * (max - min)) + min;
return "rgb("+ red + "," + green + "," + blue + ")";