<html style="height:100%"> <body style="height:100%"> <div style="height:100%;width:100%"> <script> function warn() { import mx.controls.Alert; Alert.show("You have clicked me!","You did"); } </script> <input id="inp1" type="submit" value="Click Me" onClick="warn()"/> </div> </body> </html>
Into AS code this class can be referenced with appCtx; you can access to every component in the application with the getComp method passing the id attribute value of the component; in the ApplicationContext class there is, also, the property local; this property is an object you can utilize for store and read variables.
Into AS code this class can be referenced with ctx, you can access to every component in the current Frontal module with the getComp method passing the id attribute value of the component.
Here is the list of the event you can integrate into your html content:
onClick | dispatched on the mouse click on a component and turned into a Flex MouseEvent. |
onChange | dispatched on the selection of an item in a list component, or when the value of an input field changes; it is turned into a Flex Event. |
itemRollOver | dispatched when the mouse pointer rolls onto a Menu item and turned into a Flex MenuEvent. |
creationComplete | dispatched when the component has finished its construction, property processing, measuring, layout, and drawing; turned into a Flex FlexEvent. |
onLoad | the same as the creationComplete event. |
dataChange | dispatched when the data property changes; this is a property of the Flex Framework components important when these components are used as renderers; turned into a Flex FlexEvent. |
onMouseOver | dispatched when the user moves a pointing device over a component; turned into a Flex MouseEvent. |
onMouseOut | dispatched when the user moves a pointing device away from a component; turned into a Flex MouseEvent. |
onMouseDown | dispatched when a user presses the pointing device button over a component; turned into a Flex MouseEvent. |
onMouseUp | dispatched when a user releases the pointing device button over a component; turned into a Flex MouseEvent. |
onKeyPress | dispatched when the user presses a key; turned into a Flex KeyboardEvent. |
onFocus | dispatched after a display object gains focus; turned into a Flex FocusEvent. |
onBlur | dispatched after a display object loses focus; turned into a Flex FocusEvent. |
onDblClick | dispatched when a user presses and releases the main button of a pointing device twice in rapid succession over the same component; turned into a Flex MouseEvent. |
In the event listener function or, directly in the event attribute in the declaration of the tag, Frontal passes also the event object so it can be accessed by your AS code.
<html style="height:100%"> <body style="height:100%"> <div style="height:100%;width:100%"> <script> function warn() { import mx.controls.Alert; var localId : String = event.target.id; Alert.show("You have clicked the " + localId + " button!","You did"); } </script> <input id="inp1" type="submit" value="Click Me" onClick="warn()"/> <input id="inp2" type="submit" value="Click Me" onClick="import mx.controls.Alert; Alert.show('You have clicked the ' + event.target.id + ' button!','You did again');"/> </div> </body> </html>
![]() IFile by isApp.it ![]() November 2013 |