Tag Archives: Mx

Adding Links in Menu in Adobe AIR/ FLEX.

By | March 29, 2012

Hi all… In this tutorial I will show you how to add links in a menu in Adobe AIR/ FLEX. It is really simple. Just add a normal menu item and on the click handler for menu items match the label and navigate to the URL, that’s all. Check out this example. Change the mx:Application to mx:windowedApplication to… Read More »

How will you access the clipboard in an AIR application?

By | January 15, 2011

The following is a sample code to do this. Simply copy and paste. [xml] <xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()"> public function init():void{ var str : String = "Hello"; System.setClipboard(str); var versionString:String = Capabilities.version; var pattern:RegExp = /^(w*) (d*),(d*),(d*),(d*)$/; var result:Object = pattern.exec(versionString); if (result != null) { trace("input: " + result.input); trace("platform: " + result[1]); trace("majorVersion: " + result[2]); trace("minorVersion:… Read More »

How do you call an actionscript function from a html page and viceversa. How to you access the actionscript variable function from an HTML page in actionscript.

By | December 26, 2010

The following code helps you to do this. Save the following  code as am .mxml file [xml] <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()"> <mx:Script> <![CDATA[ private var calledFromJSHandlerFunction:Function = calledFromJSHandler; private function init():void{ html.addEventListener(Event.HTML_DOM_INITIALIZE, domInitialized); html.location = "start.html"; } private function domInitialized(event:Event):void{ html.htmlLoader.window.calledFromJSHandlerFunction = calledFromJSHandlerFunction; } private function calledFromJSHandler():void { mx.controls.Alert.show("ActionScript called from JavaScript", "Alert"); } private… Read More »