Moving SWF to AIR

Posted on 2009-12-28
Last Modified: 2013-11-11
I am currently using Flash to create an Actionscript 2 Projector (EXE) File.

I want to use AIR. My EXE is 4.8 MB and growing. When I convert to AIR it drops to ~200KB (WowWowWeWa!).

That's my only motivation; size.

Here are my concerns ; 3 questions.

#1. Reading Local Files : I use the projector to open a local file (C:\msconfig.txt) and load variables. Can I do this in AIR?
#2. Fullscreening : I use the projector to fullscreen (I know this works with AIR but how do I do it with Actionscript 2.0 I can't find anything that works)
#3. Updating : I can update my EXE by over-writing it and it works. Do I need to send a new package each time for the user to install? Is there any auto-update function or process with AIR? Is there any silent update process so the user wouldn't have to do anything whether updating AIR or my app?

Thanks in Advance
Question by:KodiakASP
    LVL 19

    Accepted Solution

    you can technically wrap an AS2 app in AIR, but it's not really the same thing, and will be limited:

    however, to answer your questions:

    1 - yes (kinda), AIR apps can read local files - however, you only have certain system privileges in the application directory - access to files outside the application directory can result in a security sandbox violation.
    2 - yes (kinda), AIR apps can take advantage of full screen - again, AS2 is not directly compatible with AIR, so I'm not sure how you'd do it
    3 - AIR has an update feature, but it'd need to be implemented with AS3 - again, not sure how you'd do it with AS2.

    AIR was meant to work with AS3, not AS2, so you might be able to achieve what you want, but it probably won't be straightforward.

    last thing - i don't see any way that an AIR application is going to compress a 5MB swiff to less then 200KB.  I suspect you're loading the swiff and not counting it.  You might get a little savings, but I don't see 2500% compression.
    LVL 37

    Expert Comment

    #1.  Yes...

    #2.  No, AIR requires you to use AS3...  You cannot use AS2 with it...

    #3.  I don't think you can update the app silently, but you can definitely make an app to check the server and update if necessary...


    Author Comment


    1. Thanks
    2. Keep going.... All my AS2 seems to run fine in AIR. I mean the whole thing works it just won't full screen.
    3. I would assume there is AS2?
    No It's the projector element. The SWF is only 97 KB :) uncompressed.
    When I convert it to EXE it is 4.78 MB
    When I convert it to AIR it is 200 KB :)

    Author Comment

    CyanBlue "...AIR requires you to use AS3"

    I don't think so... Under publish settings in Flash CS4 my AS2 application goes RIGHT INTO an Air installer package and runs just fine... it just won't full screen haha.
    LVL 19

    Expert Comment

    check the mike chambers blog post i linked - you can port apps to AIR, but you're really just kind of wrapping them - and you won't have direct access to a lot of the AIR-specific API
    LVL 19

    Expert Comment

    "No It's the projector element. The SWF is only 97 KB :) uncompressed.

    When I convert it to EXE it is 4.78 MB
    When I convert it to AIR it is 200 KB :)"

    gotcha - that makes more sense : )

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
    While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
    The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now