Simple Mouse Click Counter help
Goal to make a mouse click counter. (a simple clicker/tally button that keeps track of the number of clicks a user makes).
- Progress -
- Button completed
- variable passed to text field completed.
- script passing correct variable to text field incomplete.
- Button completed
- Problem -
1. Counter Variable stays at 1 and does not increase by 1 when the button is clicked.
script
var myVar=0;
button_1.addEventListener(MouseEvent.CLICK, fl_ClickToPosition);
var fl_TF:TextField;
var fl_TextToDisplay:String = myVar;
function fl_ClickToPosition(event:MouseEvent):void
{
fl_TF = new TextField();
fl_TF.autoSize = TextFieldAutoSize.LEFT;
fl_TF.background = true;
fl_TF.border = true;
fl_TF.x = 100;
fl_TF.y = 100;
fl_TF.text = fl_TextToDisplay;
addChild(fl_TF);
myVar++;
}
any and all help greatly appreciated.
Thank You