function getRandomColor() {
var max = Math.floor(200);
var red = Math.floor(Math.random() * (max - min)) + min;
var green = Math.floor(Math.random() * (max - min)) + min;
var blue = Math.floor(Math.random() * (max - min)) + min;
return 'rgb(' + red + ',' + green + ',' + blue + ')';
var stage = acgraph.create('container');
var layer = stage.layer();
layer.rect(0, 0, 500, 300).fill('#FFFFFF 0.01');
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');
e.stopWrapperPropagation();
layer.listen('click', function (e) {
textObject.text('You clicked ' + counter + ' times. ' + 'Click again');
textObject.color(getRandomColor());
acgraph.events.listen(document.getElementById('container'), 'click', function (e) {
textObject.text('You clicked ' + counter + ' times. ' + 'Click again');
textObject.color(getRandomColor());