Hi,
I have Used AIR (Desktop application) in Flex Builder to Upload a File from a local path and save it it a server path.
I need to Call this AIR(Desktop application) from my Flex Application.... i.e
I am using a link button to send a event using Script and Forward that Desktop application from Flex Screen
But it doesnot load that (Desktop application) in Screen. Only Balnk screen is loaded from path
Here is the code
AIR(Desktop application)
<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="openBrowseWindow();"
>
<mx:HTTPService id="urlpath" showBusyCursor="true" useProxy="false
" method="
POST" url="http://localhost:8080/nat/FlexAction.do?method=UrlPath
" result="pathresult(event)" fault="faultHandler(event)"
>
</mx:HTTPService>
<mx:Script>
<![CDATA[
import
mx.events.FileEvent;
import
mx.rpc.events.ResultEvent;
import
mx.rpc.events.FaultEvent;
import
mx.utils.ObjectUtil;
import
mx.controls.Alert;
private
var openFile:File = new
File()
private
function openBrowseWindow():void
{ openFile.addEventListener(Event.SELECT, onOpenFileComplete); openFile.addEventListener(Event.OPEN, load); openFile.browse(); }
private
function load():void
{ Alert.show(
"load"
);
var imageTypes:FileFilter = new FileFilter("Images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg; *.jpeg; *.gif; *.png"
);
//var textTypes:FileFilter = new FileFilter("Text Files (*.txt, *.rtf)", "*.txt; *.rtf");
var allTypes:Array = new
Array(imageTypes); openFile.browse(allTypes); }
private
function faultHandler(event:FaultEvent):void
{
//Alert.show("Fault") Alert.show(ObjectUtil.toString(event.fault)); } private { Alert.show( ) //Alert.show(ObjectUtil.toString(event.result)); } private { //mx.controls.Alert.show("event: "+event.target.nativePath +"UR!!!"); pPath = event.target.nativePath; ,path:pPath}; // Alert.show("Image Selected from Path : "+pPath); urlpath.send(parameters); //Alert.show("Passed.."+parameters); } ]]> </mx:Script> />
Here is Mxml Code for Flex Application
<?xml version="1.0" encoding="utf-8"?> <mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns="http://ns.adobe.com/air/application/1.0.M4"
>
<mx:Script>
<![CDATA[
import
mx.controls.Alert;
private function Upload():void
{
// CursorManager.setBusyCursor();
//var url:String = "HomeAction.do?method=onLoad";
//var url:String = "assets/Air.swf";
var url1:URLRequest = new URLRequest("assets/Air.swf"
); navigateToURL(url1,
"_self"
);
// CursorManager.removeBusyCursor(); } ]]>
</mx:Script>
<mx:LinkButton id="up" click="Upload()" x="295" y="215" label="UpLoad"
/>
In this code i forward using s url to Open tat Desktop application but a blank screen appears with out the proper output...
Please Help me in this to forward AIR from Flex Screen..
Thanks in Advance
With Regards
Gopinath.A
Software Developer
First Internet Systems Pvt. Ltd.,
Chennai
try this
regards
--
Leonardo França
Adobe Certified Expert Flex 3 with AIR
Adobe Certified Expert Rich Internet Application Specialist v1.0
Adobe Certified Expert Flash CS3 Professional
Certified Professional Adobe Flex 2 Developer
Adobe Certified Professional Flash MX 2004 Developer
Manager AUGDF - Adobe User Group do Distrito Federal
North America
Europe, Middle East and Africa
Asia Pacific