I found the below blog very useful for this problem
Truncating and Rounding Numbers in ActionScript 3
will also write something about it later
Truncating and Rounding Numbers in ActionScript 3
will also write something about it later
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="init()"> <mx:Script> < ![CDATA[ import mx.controls.Alert; function checkBoxClicked():void{ Alert.show("Check box clicked"); } function init():void{ //cb.selected=true; cb.dispatchEvent(new MouseEvent(MouseEvent.CLICK)); } ]] > </mx:Script> <mx:CheckBox x="93" y="43" id="cb" label="Checkbox"
change="checkBoxClicked()"/> </mx:Application>
change | Event |
flash.events.Event
flash.events.Event.CHANGE
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
selected
property
changes for a toggle Button control. A toggle Button control means that the
toggle
property is set to true
.
For the RadioButton controls, this event is dispatched when the selected
property changes.
For the CheckBox controls, this event is dispatched only when the
user interacts with the control by using the mouse.
Let's say you have a button call myButton , you can use below line to call the Mouse Click or "click" event in Action Script
myButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));