External Exam Download Resources Web Applications Games Recycle Bin

clicker

insert new button symbol clicker:

draw button:

draw instance onto Stage from Library and assign Instance Name:

new layer text:

user text tool to draw text book in text layer:

set properties of textbox you just drew Dynamic Text, instance name txtNumber, also set font:

embed the font you are using in your dynamic text box into the document:

with btnClicker instance selected on stage, open Actions panel and go Snippets → ActionScript → Event Handlers → Mouse Click Event:

add code (listed below):

control enter to test. actionscript code listing to follow you can copy paste:

btnClicker.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);

function fl_MouseClickHandler(event:MouseEvent):void
{
	// random number between 1 and 6:
  	var lucky_number = Math.floor( 1 + Math.random() * 6 );
	txtNumber.text = lucky_number;
}