HTTPService in AIR application

I have to cross post it, because I need that to get solved.
Why same HTTPService code that works in Flex does not work at all in AIR? All I am getting is HTTP service error.

Hi,
Its work in the air application same as the flex application.
You can verify it very easly.
Use this sample applicaion which is a flex based.
http://www.adobe.com/devnet/flex/quickstart/httpservice/
After this simply create the AIR project with the same code by simply replacing Application by WindowedApplication, it is working fine.Pls let me know if you have any issue.
with Regards,
Shardul Singh Bartwal

Similar Messages

  • How to Call a AIR application from Flex Application

    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  
    function pathresult(event:ResultEvent):void{Alert.show(
    "res") 
    //Alert.show(ObjectUtil.toString(event.result));}private  
    function onOpenFileComplete(event:Event):void{ 
    //mx.controls.Alert.show("event: "+event.target.nativePath +"UR!!!"); 
    var pPath = event.target.nativePath; 
    var parameters:Object = {FlexActionType:"PATH",path:pPath};  
    // Alert.show("Image Selected from Path : "+pPath); urlpath.send(parameters);
    //Alert.show("Passed.."+parameters);}
    ]]>
    </mx:Script>
    <mx:Button click="openBrowseWindow();onOpenFileComplete(event)" name="Upload" label="Upload" x="120.5" y="10"/> 
    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
    http://www.leonardofranca.com/index.php/2009/09/17/launching-an-installed-air-application- from-the-browser/
    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
    http://www.leonardofranca.com
    http://twitter/leofederal
    Manager AUGDF - Adobe User Group do Distrito Federal
    http://www.augdf.com.br
    http://twitter/augdf

  • Using async in an AIR application?

    After reading this FlexUnit tutorial:
    http://www.adobe.com/devnet/flex/articles/flashbuilder4_tdd.html
    I downloaded the files here:
    http://download.macromedia.com/pub/developer/flashbuilder4_tdd_source.zip
    ...and changed the project, FlexUnit4Examples, to an AIR application via FlashBuilder.  After I did that, it no longer passes all of its asynchronous tests.
    Do asynchronous tests have any issues or limitations with AIR?

    The problem I had was not related to FlexUnit.  It was the way I was tried to access the file system when it was an AIR application.  I used FileStream instead of what was in the tutorial that worked with a web base application, which was HTTPService.
    Since I am new with unit testing, I assumed that it was the test that was coded wrong.  I suppose I havent trusted my unit tests enough, since it told me that my source code was incorrect.

  • Problem in full screen mode air application

    Hi All
    I am facing some problem in creating an air application. I used fullscreenmode .FULL_SCREEN_INTERACTIVE to maximize the window on load the application was succeeded in some extent. But there is one problem one bottom bar is coming just under the window. can anybody please help me. I am attaching the preview with this.
    Thanks and regards

    Hi M*A*S*H 4077 thanks agan for your reply sending you the total code i used in my project.As I am a new coder my codes are not in abc please try to understand.please have a look and if u want to see my componentcode then also i can send code.component i only used in the video part.
    thank you
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:components="components.*"
        verticalAlign="top"
        backgroundColor="white"
        borderStyle="none"
        borderThickness="0"
        creationComplete="init();"
        baseline="0"
        paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0"      
        initialize="service.send()"               
        applicationComplete="fullscreenmode()"
        backgroundGradientAlphas="[1.0, 1.0]"
        backgroundGradientColors="[#CCCCCC, #090909]"
        backgroundImage="@Embed(source='assets/background/background.jpg')"
        >
        <mx:Script>
            <![CDATA[
                import mx.controls.Alert;
                import flash.display.Sprite;
                import flash.display.StageAlign;
                import flash.display.StageScaleMode;
                import mx.rpc.events.ResultEvent;
                import mx.effects.Iris;
                import mx.effects.easing.*;
                import flash.utils.Timer;
                [Bindable]
                public var secondsTillDue:int=100;
                import mx.collections.ArrayCollection;
                import mx.rpc.events.ResultEvent;
                public var bol:Boolean;
                [Bindable]
                private var images:ArrayCollection;
                [Bindable]
                private var centerpoint:Number;
                [Bindable]
                private var currentIndex : Number = 0;
                public var myTimer:Timer;
                [Bindable]
                private var mainwidth:Number;
                [Bindable]
                private var mainheight:Number;
       private function init():void {
                myTimer=new Timer(1000);
                myTimer.addEventListener(TimerEvent.TIMER,warnIfClose);
                myTimer.start();
                // Initialize the uldr variable which will be used to load the external
                // playlist XML file.
                uldr = new URLLoader();
                uldr.addEventListener(Event.COMPLETE, xmlCompleteHandler);
                uldr.load(new URLRequest(PLAYLIST_XML_URL));
            /* function setFullScreenDisplayState():void{
                 stage.displayState=stageDisplayState.FULL_SCREEN_INTERACTIVE;
          public function warnIfClose(event:TimerEvent):void{
            secondsTillDue=secondsTillDue-1;
            if(secondsTillDue==90){   
             lab1.setStyle("hideEffect", fade);
             lab1.visible=false;
             clockpan.visible=false;
             clockpan.includeInLayout=false        
             clock1.setStyle("hideEffect", fade);
             clock1.visible=false;        
            else if(secondsTillDue==88){
                mainbox
                imagePart.setStyle("showEffect",fade);
                imagePart.visible=true;
                imagePart.includeInLayout=false;
             else if(secondsTillDue==83){
                 imagePart.visible=false;            
                 imagePart.setStyle("hideEffect",fade)        
                 videoContainer.visible=true;
                 playVideo();    
                private function fullscreenmode():void{
                stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
                mainwidth=stage.width;
                mainheight=stage.height;
                centerpoint=stage.height/2;
                private function serviceHandler(event:ResultEvent):void{           
                    images = event.result.gallery.img;
                    var timer:Timer = new Timer(15000);
                    timer.addEventListener(TimerEvent.TIMER,nextImage);
                    timer.start();
                private function nextImage(event:TimerEvent):void{
                        if (currentIndex < images.length - 1){
                            currentIndex++;
                        else {
                            currentIndex = 0;
            import mx.controls.ProgressBarMode;
                 * The amount of time between calls to update the playhead timer, in
                 * milliseconds.
                private const PLAYHEAD_UPDATE_INTERVAL_MS:uint = 10;
                 * The path to the XML file containing the video playlist.
                private const PLAYLIST_XML_URL:String = "playlist.xml";
                 * The client object to use for the NetStream object.
                private var client:Object;
                 * The index of the currently playing video.
                [Bindable]
                private var idx:uint = 0;
                 * A copy of the current video's metadata object.
                private var meta:Object;
                private var nc:NetConnection;
                private var ns:NetStream;
                private var playlist:XML;
                private var t:Timer;
                private var uldr:URLLoader;
                private var vid:Video;
                private var videosXML:XMLList;
                 * The SoundTransform object used to set the volume for the NetStream.
                private var volumeTransform:SoundTransform;
                 * Constructor
                private function initApp():void {
                    // Initialize the uldr variable which will be used to load the external
                    // playlist XML file.
                    uldr = new URLLoader();
                    uldr.addEventListener(Event.COMPLETE, xmlCompleteHandler);
                    uldr.load(new URLRequest(PLAYLIST_XML_URL));
                 * Once the XML file has loaded, parse the file contents into an XML object,
                 * and create an XMList for the video nodes in the XML.
                private function xmlCompleteHandler(event:Event):void {
                    playlist = XML(event.target.data);
                    videosXML = playlist.video;
                    main();
                 * The main application.
                private function main():void {
                    volumeTransform = new SoundTransform();
                    // Create the client object for the NetStream, and set up a callback
                    // handler for the onMetaData event.
                    client = new Object();
                    client.onMetaData = metadataHandler;
                    nc = new NetConnection();
                    nc.connect(null);
                    // Initialize the NetSteam object, add a listener for the netStatus
                    // event, and set the client for the NetStream.
                    ns = new NetStream(nc);
                    ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    ns.client = client;
                    // Initialize the Video object, attach the NetStram, and add the Video
                    // object to the display list.
                    vid = new Video();
                    vid.x = 0;
                    vid.y = 0;
                    vid.attachNetStream(ns);
                    videoContainer.addChild(vid);
                    // Begin playback of the first video.
                    //playVideo();
                     //play video code goes here
                    // Initialize the Timer object and set the delay to
                    // PLAYHEAD_UPDATE_INTERVAL_MS milliseconds.
                    t = new Timer(PLAYHEAD_UPDATE_INTERVAL_MS);
                    t.addEventListener(TimerEvent.TIMER, timerHandler);
                    // Configure the positionBar ProgressBar instance and set the mode to
                    // MANUAL. Progress  bar values will be explicitly set using the
                    // setProgress() method.
                    //positionBar.mode = ProgressBarMode.MANUAL;
                    // Configure the volumeSlider Slider component instance. The maximum
                    // value is set to 1 because the volume in the SoundTransform object
                    // is set to a number between 0 and 1. The snapInterval and tickInterval
                    // properties are set to 0.1 which allows users to set the volume to
                    // 0, 0.1 - 0.9, 1.0 which allows users to increment or decrement the
                    // volume by 10%.
                    //volumeSlider.value = volumeTransform.volume;
                    //volumeSlider.minimum = 0;
                    //volumeSlider.maximum = 1;
                    //volumeSlider.snapInterval = 0.1;
                    //volumeSlider.tickInterval = volumeSlider.snapInterval;
                    // Setting the liveDragging property to true causes the Slider
                    // instance's change event to be dispatched whenever the slider is
                    // moved, rather than when the user releases the slider thumb.
                    //volumeSlider.liveDragging = true;
                    //volumeSlider.addEventListener(Event.CHANGE, volumeChangeHandler);
                    // Configure the various Button instances. Each Button instance uses
                    // the same click handler.
                    //playButton.addEventListener(MouseEvent.CLICK, buttonClickHandler);
                    //pauseButton.addEventListener(MouseEvent.CLICK, buttonClickHandler);
                    //stopButton.addEventListener(MouseEvent.CLICK, buttonClickHandler);
                    //backButton.addEventListener(MouseEvent.CLICK, buttonClickHandler);
                    //forwardButton.addEventListener(MouseEvent.CLICK, buttonClickHandler);
                 * Event listener for the volumeSlider instance. Called when the user
                 * changes the value of the volume slider.
                private function volumeChangeHandler():void {
                    // Set the volumeTransform's volume property to the current value of the
                    // Slider and set the NetStream object's soundTransform property.
                    //volumeTransform.volume = volumeSlider.value;
                    ns.soundTransform = volumeTransform;
                 * Event listener for the ns object. Called when the net stream's status
                 * changes.
                private function netStatusHandler(event:NetStatusEvent):void {
                    try {
                        switch (event.info.code) {
                            case "NetStream.Play.Start" :
                                // If the current code is Start, start the timer object.
                                t.start();
                                break;
                            case "NetStream.Play.StreamNotFound" :
                            case "NetStream.Play.Stop" :
                                // If the current code is Stop or StreamNotFound, stop
                                // the timer object and play the next video in the playlist.
                                t.stop();
                                playNextVideo();
                                break;
                    } catch (error:TypeError) {
                        // Ignore any errors.
                 * Event listener for the ns object's client property. This method is called
                 * when the net stream object receives metadata information for a video.
                private function metadataHandler(metadataObj:Object):void {
                    // Store the metadata information in the meta object.
                    meta = metadataObj;
                    // Resize the Video instance on the display list with the video's width
                    // and height from the metadata object.
                    vid.width = mainwidth;
                    vid.height = mainheight;
                    // Reposition and resize the positionBar progress bar based on the
                    // current video's dimensions.
                    //positionBar.move(vid.x, vid.y + vid.height);
                    //positionBar.width = vid.width;
                 * Retrieve the current video from the playlist XML object.
                private function getVideo():String {
                    return videosXML[idx].@url;
                 * Play the currently selected video.
                private function playVideo():void {
                    var url:String = getVideo();
                    ns.play(url);
                 * Decrease the current video index and begin playback of the video.
                private function playPreviousVideo():void {
                    if (idx > 0) {
                        idx--;
                        playVideo();
                        // Make sure the positionBar progress bar is visible.
                        //positionBar.visible = true;
                 * Increase the current video index and begin playback of the video.
                 [Bindable]
                 private var newTime:Number;
                private function playNextVideo():void{
                    if (idx < (videosXML.length() - 1)) {
                        // If this is not the last video in the playlist increase the
                        // video index and play the next video.
                        idx++;
                        playVideo();
                        // Make sure the positionBar progress bar is visible.
                        //positionBar.visible = true;
                    } else {
                        // If this is the last video in the playlist increase the video
                        // index, clear the contents of the Video object and hide the
                        // positionBar progress bar. The video index is increased so that
                        // when the video ends, clicking the backButton will play the
                        // correct video.
                        idx++;
                        vid.clear();
                        init();
                        //Alert.show("video end")
                        //positionBar.visible = false;
                private function timerHandler(event:TimerEvent):void {
                    try {
                    } catch (error:Error) {
            ]]>
        </mx:Script>
    <mx:XML id="imagesXML" source="data/images.xml" />
        <mx:Zoom id="zoom" />
        <mx:Fade id="fadein" duration="1000" alphaFrom="100" alphaTo="0" />
        <mx:Fade id="fade" />
        <mx:Rotate id="rotate"
                angleFrom="-180"
                angleTo="0"
                easingFunction="Elastic.easeInOut"
                duration="2000" />
    <mx:VBox  id="mainbox" horizontalAlign="left" width="100%" height="100%" verticalScrollPolicy="off" horizontalScrollPolicy="off">
                <mx:Panel borderStyle="none"
               borderAlpha="0"
               cornerRadius= "0"
               headerHeight= "0"
               backgroundAlpha= "0"
               borderThickness="0"
               verticalAlign="middle"
               top="100"
               height="500"
               paddingLeft="0"
               paddingRight="0"
               paddingBottom="0"
               verticalScrollPolicy="off"
               horizontalScrollPolicy="off"
               horizontalAlign="center"          
               width="{mainwidth-100}"           
               id="clockpan"
               >       
                    <mx:Label text="Current Time : " fontFamily="arial" fontWeight="bold" fontSize="15" id="lab1" color="#FFFFFF"/>
                    <components:MyWatch formatString="DD/MM/YYYY KK:NN:SS " themeColor="#0D424C" id="clock1"/>
                </mx:Panel> 
        <!--image part start-->     
        <mx:Panel horizontalAlign="left" id="imagePart" visible="false" includeInLayout="false" borderStyle="none"
               borderAlpha="0"
               cornerRadius= "0"
               headerHeight= "0"
               borderThickness="0"
               verticalScrollPolicy="off"
               paddingLeft="0" paddingBottom="0" paddingRight="0" paddingTop="0"
               horizontalScrollPolicy="off"
               backgroundAlpha= "0" width="100%" height="100%">       
                <mx:Image source="assets/images/{images.getItemAt(currentIndex).file}"
                    showBusyCursor="true" id="imagefile" width="{mainwidth}" maxHeight="{mainheight}" minHeight="{mainheight}" maxWidth="{mainwidth}" minWidth="{mainwidth}" height="{mainheight}" hideEffect="{fadein}"  x="0" y="0" maintainAspectRatio="false"/>
                <mx:Text text="{images.getItemAt(currentIndex).title}" styleName="title" color="#ffffff" x="0" y="30"/>
         </mx:Panel>
        <!--image part end-->
        <!--image part start-->      
        <mx:Panel borderStyle="none"
               borderAlpha="0"
               cornerRadius= "0"
               borderThickness="0"
               headerHeight= "0" top="0" left="0"
               backgroundAlpha= "0" verticalAlign="middle"
               verticalScrollPolicy="off"
               horizontalScrollPolicy="off"
               x="0"
               >
             <mx:VideoDisplay borderStyle="none" borderThickness="0" visible="false" id="videoContainer"
                  maintainAspectRatio="false"           
                  />
        </mx:Panel>
        <!--image part end-->
         <!--<mx:Button label="fullscreen" click="stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;"/>-->
         </mx:VBox>   
        <mx:HTTPService id="service" url="data.xml" result="serviceHandler(event)"/>
    </mx:WindowedApplication>

  • Adobe Air application with Oracle??

    Hi there,
    I am a newbee on this forum as well as for developing Adobe
    Air applications. Can any one tell me whether i can use oracle as
    database for adobe air apps or not. What about SQL Server instead
    of SQLite.
    Thanx in advance. Awaiting for your quick & favourable
    reply.
    Regards,
    Harish

    You can use java and servlets to talk to the database. If you
    have your servlet setup, just have it output xml and your flex can
    process the results:
    <mx:HTTPService id="dbService" useProxy="false"
    method="GET" result="processResults" url="{servletURL}"/>
    Then you call something like this in Actionscript:
    private function init():void {
    var s:String = 'args';
    var params:Object = {};
    params[s] = s;
    params["password"] = password;
    params["user"] = user;
    dbService.send(params);
    You can then handle the results in a method:
    private function processResults(event:ResultEvent):void { }
    or access them directly in an object via
    dbService.lastResult.
    Hope that helps. It would take a lot of time to explain it
    more in depth and there are certainly other ways to accomplish
    this.

  • Slowness in air application

    hi,
         i done a project in air but it seems to be slow in windows than ubuntu. Am not sure but i think it occurs when a popup is called. I didnot know why it happen so if anyone know it please give the reason and it will be helpfull
                                                                                                                        thanks in advance

    Hi,
    Its work in the air application same as the flex application.
    You can verify it very easly.
    Use this sample applicaion which is a flex based.
    http://www.adobe.com/devnet/flex/quickstart/httpservice/
    After this simply create the AIR project with the same code by simply replacing Application by WindowedApplication, it is working fine.Pls let me know if you have any issue.
    with Regards,
    Shardul Singh Bartwal

  • Deployment of an Adobe AIR application in an enterprise environment

    Dear Team members,
    first of all my apologies for posting this thread in more than one forum (see Installations Issues) but the argument is very important to us and I don't know where discuss it.
    I would like to post a question to you regarding deployment doubts that we are trying to address.
    My company is working on the new version of our primary application previously built as a J2EE application with some reporting functions with Flex, and we want to use AIR in order to leverage its possibilities:
    Seamless integration with existing application functionalities (implemented as standard JEE web application pages) thanks to the integrated HTML capabilities
    Improved integration of the user interface with the desktop
    Native processes to provide additional functionalities
    Our application is targeted to pharmaceutical industry, subject to FDA regulations, and it affects more than 5000 users for each customer, so we have some specific requirements affecting the deployment and distribution of the software:
    Allow to run multiple versions of the software on the same client machine (to support test and acceptance activities in addition to the production environment)
    Minimize the effort of the initial setup on each client
    Manage the version upgrades without manual activities on each client
    Keep the test/acceptance and production environments strictly aligned to improve effectiveness of formal validation (ideally, an application once validated should be transported in production without any source code modification, recompilation or repackaging)
    The current browser-based strategy is perfectly fit to these requirements, and in the shift towards a desktop-based strategy we need to continue satisfying them as much as possible. We evaluated the standard distribution strategy of Adobe AIR applications, and noticed several attention points in this scenario.
    The first issue we encountered is the back-end services endpoint discovery problem. Simply hardcoding a server URL in the packaged application could be a viable solution for public internet-accessible applications, but we need to support multiple customers in their intranet, and each one typically requires multiple environments for the application (acceptance, production, etc.). Maintaining dozens of different packages of the AIR application to support all these customer environments clearly is not the solution. Neither we want to force thousands of different users to enter and maintain the correct server location in their local preferences.
    So, we thought to use a badge hosted in the back-end application to run the local AIR application: using the underlying API, we could activate the application specifying also the network location of the back-end services. We could also rely on the badge to install the application (and the AIR runtime if necessary)… however, application packaged as native installers cannot be installed, upgraded, or launched by the badge API (and we need to package ours as native to use native processes).
    We also noticed that multiple versions of an AIR application cannot be installed side-by-side in a client machine, and that the installation and upgrade of the application can be performed only when the local user has administrative rights on the machine (using standard or native packages), forcing us to rely on external software distribution systems in some customer scenarios (introducing additional complexities in the release cycle).
    At this point, in our opinion the standard deployment strategies of Adobe AIR applications are unfit for enterprise environments. In the enterprise world, many of the applications have migrated to a completely browser-based solution, while others enhanced their client layer to comply with the requirements, for example installing only a thin portion of the client code and allowing to connect to multiple server versions/environments with it (e.g. the SAP GUI universal client). Without smarter deployment and distribution tools, AIR applications currently are a step back compared to web applications in terms of manageability.
    So, we are trying to develop a solution to address these problems, with some concepts similar to JStart: install on the client machine a launcher application capable of being activated from a web page, dynamically locate, download and run the actual client bytecode, transparently enforce client software updates, and supporting multiple applications (and multiple versions of the same application). However, we are facing many technical problems due to internal architecture of AIR and we already spent a considerable amount of effort trying to find a solution. We are now thinking to return on the choice of AIR, going back to Flex.
    What is the position of Adobe on this argument? Is Adobe aware of these issues and are there any plans on this topic? Any advice?
    Thank you in advance

    For those following along, Oliver Goldman will be answering this post in future articles on his blog.
    Many great comments and questions here. I’m working on some follow-up posts to address these; nothing I could cram into this comment field would really do your query justice. - Oliver Goldman
    Pursuit of Simplicity
    Chris

  • Communication problem between air application from swf at browser

    Hi,
    I am trying to communicate adobe air native application from brwser using swf, I check for native application installed or not. If installed then launch and if not then install and launch.
    I am facing problem when browser crashes and communication get lost with adobe air native application. And when user restart web browser and try to make local connection for communication with native application, some times it get failed. so, how to handle this state please help.
    Thanks
    Nitesh Kumar

    Hi sinious,
    How could I clean up connection when browser is aborted or lost?
    below you can find the code snippet to check for air application and connection
    airSWFLoader = new Loader();
                                  loaderContext = new LoaderContext();
                                  loaderContext.applicationDomain = ApplicationDomain.currentDomain;
                                  airSWFLoader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
                                  airSWFLoader.load(new URLRequest("http://airdownload.adobe.com/air/browserapi/air.swf"),loaderContext);
    function onInit(e:Event):void 
                                  airSWF = e.target.content; 
                                  switch(airSWF.getStatus().toString())
                                            case "available" : AirLoaderStatus = 1;
                                            break;
                                            case "unavailable" : AirLoaderStatus = 2;
                                            break;
                                            case "installed" : AirLoaderStatus = 3;
                                            break;
    private function getAppStatus():void
                                  clearInterval(intervalIdentifier);
                                  if(AirLoaderStatus == 0){intervalIdentifier = setInterval(getAppStatus,1000);return;}
                                  m_launchInstallBtn.visible = true;
                                  var statusInfo:String = airSWF.getStatus();
                                  airSWF.getApplicationVersion(m_installerFileName, m_pubID, versionDetectCallback);
    function versionDetectCallback(version:String):void
                                  if (version == null)
                                            trace("Not Installed");
                                            // Take appropriate actions. For instance, present the user with
                                            // an option to install the application.
                                  else
                                            m_isPluginsInstalled = true;
                                            // Take appropriate actions. For instance, enable the
                                            // user interface to launch the application.
    private function onlickMouse(event:MouseEvent):void
                                  m_text.text += "\nm_isPluginsInstalled:"+m_isPluginsInstalled+":::AirLoaderStatus:"+AirLoaderStatus;
                                  trace("\nm_isPluginsInstalled:"+m_isPluginsInstalled+":::AirLoaderStatus:" +AirLoaderStatus);
                                  switch(event.currentTarget)
                                            case m_launchInstallBtn:
                                                         if(AirLoaderStatus == 1)
           installAirsetup();
                                                      else
                                                                if(!m_isPluginsInstalled)
                                                                          airSWF.installApplication(m_url, m_runtimeVersion, m_argsToPass);
                                                                          airSWF.launchApplication(m_installerFileName, m_pubID, m_argsToPass);
                                                                else
                                                                          airSWF.launchApplication(m_installerFileName, m_pubID, m_argsToPass);
                                            break;
    in the above code snippet I pass localConnection for send and recieve as an argument in m_argsToPass.
    the connection names strarts with "_".
    In the air application I I split the event arguments like given below
    argsArray = event.arguments.toString().split(",");
    and then try to establish connection.
    Please suggest, how could I clean the connection on lost/ abort of browser, since then swf object embeded in browser also get lost.

  • Problem with Expose and Adobe AIR application -can't click on app in Expose

    I just installed a new Adobe AIR application called TwitterLocal. The app was working fine until I accidently hit some keyboard shortcut and the application window disappeared. I figured I accidently assigned the window to some other "space," however I do not have SPACES turned on. Furthermore, when I select EXPOSE, I can now see the content of the application's window, however if I click on the app (which takes on that grey-highlight appearance when you mouse over it) the desktop returns to its normal position. I can see via the top status bar that the app is currently selected, but I cannot access the app window.
    Is there any way to send an app that was "sent" to expose back to the normal desktop? I've tried rebooting and even uninstalling/reinstalling the app but it is still lost in expose.
    Any thoughts on this would greatly be appreciated.

    Solution was to change display to lower resolution, then the Adobe AIR app TwitterLocal became visible on the standard desktop and I was able to click on and move the app window towards the left of the desktop. Once I switched the resolution back, everything was ok.

  • How to open and show a word, excel, ppt file in Adobe AIR application?

    Dear All,
    I have a requirement to open a MS- word/ Excel file in the AIR application.
    On click of a brows button a file reference box opens...on any file
    selection...it should open in the application itself...
    so plz let me know the solutions u have...

    Here is your basic issue: setting a classpath (and presumably compiling and executing a program) is one of the most basic, fundamental concepts in Java. I would advise you to follow JVerd and Annie's links and get started on a tutorial. Try writing a simple HelloWorld application before delving into POI. When you are more comfortable writing and compiling programs, and post a specific question, it will be much easier to help you.
    - Saish

  • How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    If the data is on a remote server (for example, PHP running on a web server, talking to a MySQL server) then you do this in an AIR application the same way you would do it with any Flex application (or ajax application, if you're building your AIR app in HTML/JS).
    That's a broad answer, but in fact there are lots of ways to communicate between Flex and PHP. The most common and best in most cases is to use AMFPHP (http://amfphp.org/) or the new ZEND AMF support in the Zend Framework.
    This page is a good starting point for learning about Flex and PHP communication:
    http://www.adobe.com/devnet/flex/flex_php.html
    Also, in Flash Builder 4 they've added a lot of remote-data-connection functionality, including a lot that's designed for PHP. Take a look at the Flash Builder 4 public beta for more on that: http://labs.adobe.com/technologies/flashbuilder4/

  • Right way to code an AIR application that uses sqllite database

    I am developing an AIR application that uses sqllite database.I want to know the correct way in which I should create the connections and SQLstatements according to MVC pattern.For example,whether i should have a single SQLStatement object for all my sql operations or I should use separate objects for insert,delete,select etc.I know how to open connection,execute statements and all,but i want to know the professional way of writing it.

    Make a controller for connect to db and save the connection in global varible (in model). Use this connection variable whenever u wanna execute the sql statements. Create seperate dao's for each table. Queries should be executed under the daos. You can call the method under the dao for execute the query from controller and show the result in view.

  • Display image in standalone AIR application

    I have loaded images and like to display image in standalone AIR application. But I cannot get it work. The code as follows:
    private function ImageLoader(url:String):void
    var request:URLRequest = new URLRequest(url);
    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
    loader.load(request);    
    private function loaderComplete(event:Event):void
    var scaleFactor:Number = 1;
    var uic:UIComponent = new UIComponent();
    try
    var bmp:Bitmap = event.target.content as Bitmap;
    var bmd:BitmapData = bmp.bitmapData; //Bitmap(event.target.content).bitmapData;
    var scaledBMD:BitmapData = new BitmapData(400, 400);
    var matrix:Matrix = new Matrix();
    matrix.scale(scaleFactor, scaleFactor);
    scaledBMD.draw(bmd, matrix, null, null, null, true);
    uic.x = 40;
    uic.y = 40;
    uic.addChild(new Bitmap(scaledBMD));
    catch (errObject:Error)
    trace(errObject.message);

    Found answer by adding mx:Canvas and add
    iconCanvas.addChild(uic);
    after
    uic.addChild(new Bitmap(scaledBMD));
    <mx:Canvas id="iconCanvas" width="10" height="10" horizontalScrollPolicy="off" verticalScrollPolicy="off" x="0" y="0" clipContent="false"/>
    Is anyone create "Canvas" by using new Canvas and get it works? example:
    var canv:Canvas = new Canvas(...);

  • FLV Playback and Seekbar on different native windows in one Air application

    Hello Everyone.  I'm trying to make a simple video playback AIR application that utilizes the initial native window to house a transport control with a seekbar on it.  Once the application launches, it creates a second (new) window on my second screen and places a FLVPlayback instance on that new window.  Everything works just like it want it to except for one thing.  When the seekbar and FLVplayback instance are not located on the same window stage, the seekbar handle sticks to the mouse when trying to scrub through the video.
    I've added both the transport control and the FLVPlayback instance to the original native window as children and I have also added both of them to the new window as children and everything works just fine.  It's only when they are separated and located on different stages that the seekbar acts up.  When they are on the same stage, I can click on a point on the seekbar and the video jumps to that spot and continues to play and I can also scrub the seekbar, the video updates as I scrub, and when I release the mouse, the seekbar handle stays where I released the mouse.  When they on separate stages, the seekbar handle continues to follow the mouse movement without releasing it.  The video updates as the seekbar handle is moved due to it sticking to the mouse, but if I release the mouse, the handle is still moving with the mouse and the video is still being scrubbed.  Like I said, everything works great except for this and I have reached my limit with time spent on this issue.  Does anyone have any insight into this?
    Here's my code for the project.  This is my first AIR application, so I am coding it as I am learning, please be kind.
    import fl.video.*;
    import flash.display.*;
    import flash.desktop.*;
    import flash.events.*;
    import fl.video.MetadataEvent;
    import flash.geom.*;
    import flash.ui.Mouse;
    import flash.text.*;
    GLOBAL SETUP
    var flvControl:FLVPlayback;
    var MasterWindow = stage.nativeWindow;
    var screen1:Screen = Screen.screens[0];
    var screen2:Screen = Screen.screens[1];
    MASTER WINDOW SETUP
    this.loaderInfo.addEventListener(Event.COMPLETE,maximize);
    transControl.playPauseButt2.addEventListener(MouseEvent.CLICK, PlayButton);
    if (Screen.screens.length > 1){
              createVideoBKG();
              createVideoPlayer();
    GENERAL FUNCTIONS
    //Maximize the initial screen
    function maximize(e:Event) {
              MasterWindow.x = screen1.bounds.left
              MasterWindow.maximize();
              MasterWindow.stage.scaleMode = StageScaleMode.EXACT_FIT;
    //Hide Mouse Behind Video Window On Roll-Over
    function MouseRollOver(e:MouseEvent):void
              {          Mouse.hide()          }
    function MouseRollOut(e:MouseEvent):void
              {          Mouse.show()          }
    //Play-Pause Button Control
    function PlayButton(event:MouseEvent):void
                        if(transControl.playPauseButt2.currentFrame==1 ){
                                  transControl.playPauseButt2.gotoAndPlay(2);
                                  flvControl.play();
                        else {
                                  transControl.playPauseButt2.gotoAndPlay(1);
                                  flvControl.pause();
    function CloseWindow(e:MouseEvent):void
                        NativeApplication.nativeApplication.openedWindows[2].close();
    VIDEO BKG SETUP
    function createVideoBKG(e:Event = null):void{
              var newOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
              newOptions.type = NativeWindowType.LIGHTWEIGHT;
              newOptions.systemChrome = NativeWindowSystemChrome.NONE;
              newOptions.transparent = true;
              var videoBKG:NativeWindow = new NativeWindow(newOptions);
              if (Screen.screens.length > 1){
                        videoBKG.x = screen2.bounds.left;
              videoBKG.maximize();
              chromeSetup(videoBKG);
              videoBKG.activate();
    //Video BKG Chrome Setup
    function chromeSetup(currentWindow):void {
              var vidBKG = new video_bkg();
              vidBKG.name = "video_bkg2";
              vidBKG.addEventListener(MouseEvent.ROLL_OVER, MouseRollOver);
              vidBKG.addEventListener(MouseEvent.ROLL_OUT, MouseRollOut);
              currentWindow.stage.addChild(vidBKG);
    VIDEO Player SETUP
    function createVideoPlayer(e:Event = null):void{
              var newOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
              newOptions.type = NativeWindowType.LIGHTWEIGHT;
              newOptions.systemChrome = NativeWindowSystemChrome.NONE;
              newOptions.transparent = true;
              var videoPlayer:NativeWindow = new NativeWindow(newOptions);
              if (Screen.screens.length > 1){
                        videoPlayer.x = screen2.bounds.left;
                        videoPlayer.y = screen2.bounds.top;
                        videoPlayer.width = screen2.bounds.width;
                        videoPlayer.height = screen2.bounds.height;
                        videoPlayer.stage.scaleMode = StageScaleMode.NO_SCALE;
              videoPlayer.alwaysInFront = true;
              var DVR = new DVR_Player();
              DVR.name = "DVR";
              DVR.x = 0;
              DVR.y = 0;
              DVR.addEventListener(MouseEvent.ROLL_OVER, MouseRollOver);
              DVR.addEventListener(MouseEvent.ROLL_OUT, MouseRollOut);
              videoPlayer.stage.addChild(DVR);
                flvControl = DVR.display2;
              flvControl.width = 1280;
              flvControl.height = 720;
              flvControl.skin = null;
              flvControl.autoPlay=false;   
              flvControl.isLive=false;
              flvControl.fullScreenTakeOver = false;
              flvControl.align = VideoAlign.CENTER;
              flvControl.scaleMode = VideoScaleMode.NO_SCALE;
              flvControl.source = "olympics.f4v";
              flvControl.seekBar = transControl.seekbarContainer2.seeker;
              videoPlayer.activate();

    Does anyone have any ideas about this?

  • To open a Excel and Doc file inside the AIR application

    How to open a Excel and Doc file inside the AIR application.  I have opened the PDF file inside the AIR application.  But i got stuck in opening the Exce and Doc file.  Please help me in this issue.

    AIR does not support this inherently. However, you could write code to parse these file formats. For example, the following is an ActionScript 3.0 library for reading and writing Excel files:
    http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1375018

Maybe you are looking for

  • [b]Java Stored Procedure generating ora-932 in Oracle 9i [/b]

    Hi , I have written a Java Stored procedure. And I have written a wrapper function as bellow FUNCTION "GENERATE_AC_EXCEL_REPORT_FN" ( refCursorCall VARCHAR2, fromDate Date, ToDate Date, nsn VARCHAR2, period varchar2, site VARCHAR2, vendor VARCHAR2, s

  • Web Service Scenario Not Working

    Hi Sdners, I am working on Support project where I have web Service to RFC Scenario which is synchronus scenario. when the user sending the WSDL request to XI it's woking fine in for Devlopment but it is not working QA .In QA i am gettings error belo

  • Ringtones not working correctly

    Since the last update I cannot change my ringtones any longer. No matter what I do, only the original ringtone goes when someone calls me. Anyone else has this problem?

  • Problem syncing upgrade iPhone with older Macbook

    Today I synced my iPhone 3GS for the first time with my Dad's Macbook Pro. I updated my iPhone to version 4.3.2m as it suggested. Now I can't (re)sync my iPhone to my own (older) Macbook Pro (10.4.11). It says I need iTunes 10 , but I can't get that

  • Master data templates for Talent management

    Dear All, Please let me know  if someone can provide me with templates for PD. We are in the midst of an implementation and the employee nos are huge. It would take a long time for the client to complete the talent architecture and hence do not want