Reuse a Flex App as AIR application

Hi!
I've developed a Flex application and now I want to use it
again with the same codebase as an AIR application.
But there are several factors that don't work as expected.
The Flex App uses some advanced features that make reuse a
little bit complicated:
I use the latest Cairngorm.swc in the app.
I use ResourceBundles in the app.
I often use "Application.application" in the app.
These are the three things, which make porting to AIR a
little bit complicated.
Are there any "Best practices" for sharing the same codebase
for Flex and AIR?
I've tried to make the Flex app a module and reuse that, but
then I get troubles with ResourceBundles, also the addressing
doesn't work correctly anymore (I've refactored the
Application.application.<element> calls to say:
Application.application.app.<element> where "app" is the ID
of the ModuleLoader). But I get the error that
<ApplicationType> cannot be converted to ModuleLoader.
Then I've tried to make a SWC out of the App, didn't work
either.
Has someone already done things like that?
What's the best way to accomplish that?
Thanks a lot for replies!
Bye,
Fritz

Hi.
Based on Adobe's document
http://www.adobe.com/devnet/air/flex/articles/flex_air_codebase.html
which I haven't found earlier, I got the project working with all
my special things lik Cairngorm and ResourceBundle.
Currently I'm writing a tutorial how this works, I'll post it
for further use on monday :-)
Bye,
Fritz

Similar Messages

  • Existing Flex App With Air

    I have been working on a large Flex App using CFM as the db
    access layer. Essentially I understand that AIR will allow my RIA
    which is currently solely used in a browser run off line as a
    desktop app. However, my question is what's involved in modifying
    this application to push 'new' data added while off line back to
    the db when a connection becomes available.
    Some guidance on this subject would be great, or is this
    something which should require no modification?

    AIR doesn't give you any synchronization mechanisms. It's
    entirely up to you how you manage offline operation.
    What AIR actually does is provide an out-of-browser runtime
    environment for Flex apps, plus some additional APIs that Flex
    couldn't give you due to its browser-based nature. Among them are
    access to a local database, plus more generalized local filesystem
    access. Between these two things, you can store local changes while
    offline, then work out some way to push them to the server at a
    later time.
    You might make your first step into the AIR world just a
    simple port of the existing application to run under the AIR
    framework. This won't give you any new offline capability, but it
    will let the app run as a desktop app, outside a browser. This may
    make more sense for your type of application. Then once you get
    that going, you can worry about synchronization.

  • Flex with php air application

    Hi ,
    I am new in flex.
    Actually i make a flex with php desktop application. There are two problems which i am not getting:
    a.) I make three module which i load on tab navigator click . These mudules working fine . But when i make this project export relese build to make .exe file . These modules not added in installation file.
    i.e after installation i have to copy these modules .swf file in program files where the application installed. So i want to know is there is any method so that module added in the .exe file so that they by default goes at the
    time of installation of exe.
    b.) I use php services in this project and when i insatlled the application to system its not working untill i add the the project service php file and zend frame work folder on user wamp . Is there any method that all these happen by default at the time of insatllation.

    Hi,
    AIR is best suited to be a client application.
    P.S: Since you are using PHP, you may want to take a look at
    amfphp so that you can use AMF to speed up data transfer between
    your AIR app and the PHP server.

  • CS4 or FLEX Builder for AIR Application?

    Hello,
    I have installed CS4 and Flex builder 3. I would like to develop some desktop applications, which is the best editor to develop AIR application?
    Thank you

    I faced a similar choice recently: Flash or Flex for developing CS4 panels.
    John Nack advised me to use Flex Builder. He was right. For a desktop AIR application or something like CS4 panels, the Flex Builder IDE is more powerful and helpful. If you're a developer familiar with other programming tool IDEs, like Microsoft Visual Studio, various Java IDEs, etc. then you will find the Flx Builder IDE to be more intuitive.
    Flash is a good choice for developing animated SWF panels that are driving things like Flash movies. If you use Flash, you'll have to deal with the Timeline. With Flex Builder, you don't.
    They both provide access to Action Script. But they expose functionality differently. Also, Flex Builder provides some data visualization tools, etc. that are not part of Flash.
    Mitch

  • Converting Flex app into Air?

    i wonder is there a way to convert a Flex 3 application into an Air app for desktop distribution?
    thanks
    krs

    You can easily do this by changing the <mx:WindowedApplication> tag of the main app file to <mx:Application>.
    Any other code that is AIR only, such as accessing the local hard driver with FileSystemTree, etc. must be removed, disabled, or modified as appropriate.
    If this post answers your question or helps, please mark it as such.

  • Can you call external exe file from Flex Air Application like notepad.exe

    Im trying to make my Air Application open an External exe file anyone know if this can be done?

    Hi,
    If you want to share code between a flex app and AIR, you
    could isolate the common bits as a swc file and link to the swc
    from both the flex and air project.
    Also, you could have the flex mxml file and air mxml file
    load the same module (which has the same stuff as your original
    flex application) using ModuleLoader.
    Or, you could even load the swf of your flex application
    using SWFLoader in your air mxml file.
    Basically, check out creating flex libraries, modules and
    runtime loading of swfs.

  • How to Build a Flex App that works with both SQLite and MySQL?

    Let me explain a bit: I am developing an app that will
    be published as an AIR application using SQLite, as well as a FLEX application that will use MyDSQL via web services.
    I want to develop both applications in such a way that all the components can be reused, and I only have to do minimal redevelopment. I have started witht the AIR application. Once I have it completed, I want to publish the application (with minimal redevelopment) as a FLEX web app.
    My thinking is that I contain the database accesses in the Application, and passing the data via interfaces to the respective modules, as well as receiving data from the modules back to the Application to be written to the database. This was the only changes between the FLEX and the AIR application will be how the database access is handled in the Application file, and I can leave all modules as is and will be able to maximize reusability,
    I haven't done this before, and was wondering what the best approach for this is?
    Thanks!

    It seems very difficult to find best practices on how to structure your database layer in FLEX. None of the books I have go into detail about it, nor do any of the websites I have found so far, including the Adobe Flex tutorials. Sure, they explain how to interact with databases, but don't seem to care about best practices for structuring your application.
    Can anyone point me in the right direction for this?
    Thanks!

  • Adobe AIR Application won't install

    Also, tried reinistalling latest version of Adobe AIR but a message appears saying that the latest version of Adobe AIR is already installed, even though I thought I had unistalled it with the help of Microsoft Fix it (i.e. it no longer appeared in the least of programs installed on the computer).
    I am using a Samsung laptop with Windows 7.
    Following my latest attempt to install the application, I located the Adobe AIR log:
    [2013-11-29:20:21:14] Runtime Installer begin with version 3.9.0.1210 on Windows 7 x86
    [2013-11-29:20:21:14] Commandline is:
    [2013-11-29:20:21:14] Installed runtime (3.9.0.1210) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2013-11-29:20:21:18] Launching subprocess with commandline c:\Program Files (x86)\Common Files\Adobe AIR\Versions\1.0\Resources\Adobe AIR Updater -installupdatecheck
    [2013-11-29:20:21:18] Runtime Installer end with exit code 0
    [2013-11-29:20:21:37] Application Installer begin with version 3.9.0.1210 on Windows 7 x86
    [2013-11-29:20:21:37] Commandline is: "C:\Program Files (x86)\Mr Smooth\MrSmooth.1.0F.air"
    [2013-11-29:20:21:37] Installed runtime (3.9.0.1210) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2013-11-29:20:21:37] Got an unexpected fatal error while loading SWF: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="app:/Adobe AIR Application Installer.swf" errorID=0]
    [2013-11-29:20:21:58] Application Installer begin with version 3.9.0.1210 on Windows 7 x86
    [2013-11-29:20:21:58] Commandline is: "C:\Program Files (x86)\Mr Smooth\MrSmooth.1.0F.air"
    [2013-11-29:20:21:58] Installed runtime (3.9.0.1210) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2013-11-29:20:21:58] Got an unexpected fatal error while loading SWF: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="app:/Adobe AIR Application Installer.swf" errorID=0]
    [2013-11-29:20:22:03] Application Installer begin with version 3.9.0.1210 on Windows 7 x86
    [2013-11-29:20:22:03] Commandline is: "C:\Program Files (x86)\Mr Smooth\MrSmooth.1.0F.air"
    [2013-11-29:20:22:03] Installed runtime (3.9.0.1210) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2013-11-29:20:22:03] Got an unexpected fatal error while loading SWF: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="app:/Adobe AIR Application Installer.swf" errorID=0]

    Please note that I managed to resolve this myself by first of all deleting the Adobe AIR folder contained within C\Program Files (x86)\Common Files of my hard drive and then re-attempting the Adobe Air application installation. This immediately caused a prompting of an update to Adobe AIR, which I ran. It  seems that the Adobe AIR application installation package contained an older version of Adobe AIR than was already installed within the 'Common Files' folder, and this apparently led to the error (sorry, I cannot explain it any more technical terms than that!).

  • Issue in setting flex app in load balanced environment using SSL

    I have developed the dashboard in my application using flex 3.0. For this I have used JSP wrapper around the flex application. My application runs on JBoss application server. for communication between flex app and my application i am using LCDS. HTTPService component is being used to receive data from the server. Channel definitions are given in service-config.xml for amf and http channels and for both secure secure and not secure mode. In my proxy-config.xml i have defined Channels and destinations.
    services-config.xml
    <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
        <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
        <properties>
              <polling-enabled>false</polling-enabled>
        </properties>
    </channel-definition>
    <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
        <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
        <properties>
              <add-no-cache-headers>false</add-no-cache-headers>
        </properties>
    </channel-definition>
    <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
        <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
    </channel-definition>
    <channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
        <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
        <properties>
            <add-no-cache-headers>false</add-no-cache-headers>
        </properties>
    </channel-definition>
    proxy-config.xml
    <default-channels>
        <channel ref="my-http"/>
        <channel ref="my-amf"/>
        <channel ref="my-secure-http"/>
        <channel ref="my-secure-amf"/>
    </default-channels>
    <destination id="dashboardService">
        <properties>
    <url>/kr/servlet/DashboardServlet</url>
        </properties>
    </destination>
    <destination id="dashboardJSPService">
        <properties>
    <url>/kr/krportal/dashboardJSPService.jsf</url>
        </properties>
    </destination>
    In my development environment both secure and non secure mode were working fine. Now when I have deployed it behind the load balancer(which accepts secure requests only and if the request is not secure it redirects it to secure url) there is no response from the message broker servlet. One thing more I have observed is when the environment is non load balanced there are request like 'http://{server.name}:{server.port}/{context.root}/messagebroker/http'. and these requests are post request. But in load balanced environment with ssl the request is again like 'http://{server.name}:{server.port}/{context.root}/messagebroker/http' which is a post request and it is redirected to 'https://{server.name}:{server.port}/{context.root}/messagebroker/http' which is a get request. The content returned by this get request is null.
    Looking for some comments
    Thanks
    Abhishek Gupta

    if the load balancing environment is already well configured, thes rest is very easy, there is no difference between a configuration of load balancing environment and a simple one, for you that is transparent, except the manual deployment and manual copying
    of files in the directory 15

  • Embedded ActiveX in a Flex app

    We have a requirement to embed a signed ActiveX control in
    both a Flex and an AIR application. Flex does not support HTML
    content, but AIR does, but it still filters out the Object tags. We
    are looking for some help to see how we can achieve this, either
    via a custom component or a hook available to make this possible.
    We've explored the iFrame approach, but have run into more issues
    than solutions with that approach.
    Thanks!

    Hi Cnunciato,
    Can you please expalin a bit more the whole process with which i willl be able to use activex in flex and which will also help in hoating activex in IE.
    If you could provide some link to some example or some sample code , i would be highy grateful.
    Thanks
    Vasu Gulati.

  • AIR application with Flex 4.5 will not render content. What gives?

    OK,
    So I've upgraded to Flash Builder 4.5 Premium and I am unable to develop desktop AIR applications with the 4.5 Flex SDK. I start by simply creating a brand new AIR application using the default SDK (Flex 4.5). I set the title property on WindowedApplication and include a simple Label component. The project compiles fine but when I run the application all I see is the adl window in the dock but that's it. If I modify the Main-app.xml file to set the visible attribute to true, I will get a small window but there is no content although the output window shows the application swf being loaded. Checking the release version of the Main-app.xml file shows the correct path location to the swf.
    Here is what I've tried so far:
    Install/reinstall Flash Builder, 4+ times
    Downloaded the trial installation twice
    Downloaded the SDK's for 3.6, 4.1 and 4.5.0. I then copied each SDK folder and merged the AIR 2.6 SDK with each copy. So now I have 6 SDK versions; one pristine and the other with the AIR 2.6 SDK merged. I then added each SDK individually and created an AIR desktop application for each. Each and every one works fine with the exception of the two 4.5 SDK's. They will not render content.
    I created a simple creation complete handler for the application that declares a simple variable and assigns a value to it. I then put a break point on the assignment and it never gets caught. More evidence that the swf isn't getting loaded.
    The computer I'm running on is a Mac Book Pro with Snow Leopard 10.6.7. If I create a web project in each of the 6 SDK's, those will work just fine. What the heck is it with Flex 4.5 and the AIR 2.6 SDK on this machine? I have the AIR 2.6 runtime installed as well as a number of AIR applications that work just fine. I also tried my 4.5 test on my windows machine and that worked like a champ.
    I am completely out of ideas. Finding information has been difficult because everyone is all about mobile so searching for desktop issues is a losing battle. I realize this is a long email but I'm desperate for help. There must be someone out there that knows more about the low level interaction between Flex 4.5/AIR 2.6 and the OS.

    Well, I finally found the issue, a corrupted mm.cfg file in /Library/Application Support/Macromedia. I deleted the file and then adl ran just fine.

  • Need HTTPService and play video in flex 4.6 Air Mobile App

    We are porting a flex 3.2 app to mobile app. The 3.2 app uses mx.rpc.http.HTTPService to send XML requests for data and launch video web pages. Will a flex 4.6 Air Mobile app be able to do the same? If so, what replaces mx.rpc.http.HTTPService? I read that mx components will not work in Flex mobile apps.

    HI,
    Its working fine.And the mxml components which are displayobject should not be used in the mobile application except the chart.
    So nothing wrong with using "mx.rpc.http.HTTPService",you can also use  <s:HTTPService/>
    Also there is a nice way to see which components should be used or which not for the mobile application.
    Simply mouse over on the component when you have used it.You can see a message on that if that is not optimized for the mobile application like for the combobox you can see this message:-
    "Adobe discourages using ComboBox when targeting profiles: mobileDevice."
    While this is not the case with <s:HTTPService/>.
    with Regards,
    Shardul

  • Deploying AIR applications with flex & BlazeDS

    I have a Flex app which needs to run on the server in the
    background. I was thinking of turning into an AIR app since it
    really doesn't need to run on the browser. But how could I deploy
    this.
    I am sending my entire flex project as a .war file to deploy
    on the server and am using BlazeDS to work with some java backend
    code. But all of the tutorials for AIR seem to assume some sort of
    manual install method and I just want to bundle it with my current
    project. Is this possible? And if so, how is this done?

    I actually do send the PNG as a byteArray to Java from Flex
    via a remote object method. The reason I need Flex is because I
    specifically want to use the charting software package from Flex
    charting. The Flex look and feel out of the box for the interface
    and the chart is far superior to what I could create in Java.
    Here is a quick over view of what happens in the application:
    1. launch java app
    2. Java then launches a Flex instance for each report defined
    in the database
    3. java pushes live data to each Flex instance from database
    4. after Flex plots data, it sends ByteArray of the png to
    remote java method
    5. java saves png to file locally on the server
    How would you simplify this process? I'd really appreciate
    your take on this.

  • Need guidance in developing AIR Application based on flex 4.0.0.10396 sdk beta.

    Hi Friends,
                I need to develop a desktop mail client for web based RIA developed in extjs. The air application has to communicate with a flex application hidden inside the web app and get the SMTP Details and send mail using the socket connection.
    Till date i have found few plugins and i am testing out each one of them.
    1) byteArray SmtpMailer for socket mailing which has login authentication, attachment support.
    2) suiggly with halo rich text editor for spell check enabled mail composer.
    3) flash network localConnection for communication between web flex hidden inside extjs ria app and air app, The flex application and extjs application communicate using FABridge.js.
    4) updateFramework for frequently updating the air app with new features.
    Drawbacks i face:
    1) ByteArray SmtpMailer works fine but i am unable to find a plugin for SSL encryption support which is required for connecting with gmail SMTP server.
    2) The flex web application size grows upto 1.8MB(approx) with all SDK librarys which are part of 4.0.0.10396 SDK, which is thrice as big as the extjs RIA app.
    3) The updateFramework for updating a air application throws errors, which is diffcult to troubleshoot or understand by novice like me.

    Ok, just figured this out. The cert I created was somehow malformed. I simply created a new one with the Flash IDE which worked fine. Any other method of creating the cert that I tried failed, including the keytool command line utility.

  • Open PS (CS-CS4) and load image from flex/air application?

    Hello,
    (Not sure wether to post this in the AIR forum or the FLEX forum?)
    I am at a loss on how to get my simple application to work. I have a small desktop air application that simply opens Photoshop and runs an action. I used switchboard and the application ran great on PC and MAC. However it only worked for CS3, and CS4 not CS or CS2?. Plus the size of switchboard was a bit large for my small app. I am willing to live with that though . I am using Air with Flex and wanted to know if perhaps there is a beter approach? All the application does is open photoshop, loads an image, and runs an action. Can I do this for all versions of Photoshop using switchboard? Can I do this without switchboard and just use javascript. The big issue is the Air app needs to open Photoshop, and most of the examples have me open PS first and then execute a script located in the PS directory. This needs to work outside of the PS directory. Any examples are appreciated.
    I have looked at the following:
    - SwitchBoard : only works for CS3-CS4 (on my tests)
    - PatchPanel: same issue, plus seperate SDKs
    - ExtendScript: requires script to be run from PS not Air

    Of course you may have some unstated reason for doing this in Air, but if not...
    Google photoshop droplet....
    Bob

Maybe you are looking for

  • The space bar is no longer working to play/pause, after the latest update to iTunes.

    I hope this is not on purpose. It is a wonderful tool to stop the music when I need to answer my phone in the office.

  • Trying to understand  - 'isPrimitive'

    well, i'm learning java now, was doing well so far, untill the Class subject. from what i understand isPrimitive is supposed to check if a class is associated to a primitive type. i can't understand exactly what it means. i've tried to run little pro

  • Digital waveform output

    hello everybody first of all: i'm working with m-series card pci 6259 and measurement studio c++. i want to output digital waveforms to sixteen digital outputs. the waveform buffer should contain at least 720 points. the frequency at which the output

  • Airport Express printer and modem compatibility

    I have an Epson Stylus Photo RX620 printer that works fine with my iMAC. I connect to the internet through an ntl Cable Modem. Has anyone used either of these devices with an airport express and did they work o.k? iMAC 1.83MHz Intel Core Duo   Mac OS

  • No EDGE means no iPhone functions?

    So, 24 hours into my iPhone ownership and my E disappears. No internet, no visual voicemail, no e-mail and no text messaging. No text messaging? Yep. At least with e-mail, voicemail and safari, the iphone told me it couldn't connect. I've been sendin