// Author: Robert Lie (Mobilefish.com) // More information, see: https://www.mobilefish.com/developer/flash/flash_quickguide_actionscript_3_examples.html button_mc.addEventListener(MouseEvent.CLICK, onClick); function onClick(event:MouseEvent):void { var value:uint = Math.ceil(Math.random() * 6); dice_mc.gotoAndStop(value); } button_mc.buttonMode = true;