mouse click generate number
I'm trying to make a mouse event that return a random number to a dynamic text box...
when i publish the function that generates the number works
but when i call the function with the mouse click it doesn't work.
Could someone help me?
Tnks!!!
var resultado:Number=sorteio();
function sorteio():Number
{
return Math.round(Math.random() *500);
}
sorteio();
sorteio_txt.text = String(resultado);
my_btn.addEventListener(MouseEvent.CLICK, onClick);
function onClick(e:MouseEvent):void
{
sorteio();
}
