AIR for desktop and multiple swfs

I know when packaging AIR for mobile devices, you can load external swfs as long as they contain no code, but I was wondering if the same limitation exists for AIR on the desktop.
Building a kiosk application and would like to organize and load the various 'views' similar to how I would create and organize a flash based web application.

Hi jbach...
In AIR for desktop, you can definitely load external swfs and they can contain code (works on Android also).
There's a in-depth discussion of how to accomplish this here:
http://blogs.adobe.com/cantrell/archives/2010/03/extending_air_applications_with_plugins.h tml
This article talks about security considerations, etc - and is worth understanding.
However, if you want to just test it out without worrying about security:
var stream:FileStream = new FileStream();  
stream.open(_file, FileMode.READ);
var bytes:ByteArray = new ByteArray();
stream.readBytes(bytes);
stream.close();
var context:LoaderContext = new LoaderContext();
context.allowCodeImport = true;
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);
loader.loadBytes(bytes, context);
function loadHandler(e:Event):void
_content = DisplayObject(e.target.content);
So basically:
Read the file as a byte array.
Create a loader context and set allowCodeImport to true.
Create a loader and use loadBytes to "convert" to a useable swf.
On complete, e.target.content contains your swf (fully accessible with code, etc.)
Hope this helps!  Good luck with your application.

Similar Messages

  • AIR for desktop and TouchEvents

    Building a kiosk application that only requires button press and button drag(scroller) detection.
    I DON'T need multitouch, or gesture recognition.
    Will I still need to substitute any MouseEvents for TouchEvents?

    Hi jbach...
    In AIR for desktop, you can definitely load external swfs and they can contain code (works on Android also).
    There's a in-depth discussion of how to accomplish this here:
    http://blogs.adobe.com/cantrell/archives/2010/03/extending_air_applications_with_plugins.h tml
    This article talks about security considerations, etc - and is worth understanding.
    However, if you want to just test it out without worrying about security:
    var stream:FileStream = new FileStream();  
    stream.open(_file, FileMode.READ);
    var bytes:ByteArray = new ByteArray();
    stream.readBytes(bytes);
    stream.close();
    var context:LoaderContext = new LoaderContext();
    context.allowCodeImport = true;
    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);
    loader.loadBytes(bytes, context);
    function loadHandler(e:Event):void
    _content = DisplayObject(e.target.content);
    So basically:
    Read the file as a byte array.
    Create a loader context and set allowCodeImport to true.
    Create a loader and use loadBytes to "convert" to a useable swf.
    On complete, e.target.content contains your swf (fully accessible with code, etc.)
    Hope this helps!  Good luck with your application.

  • I have flash professional cc and I need air for desktop application with .exe or .air that should contain all swf's and captive air runtime in one Installer only . I don't want to install separate adobe air runtime .

    I need Air for desktop application either in .exe or in .air with embedded captive runtime just like .apk . I don't want to install adobe air separate . everything should come in installer
    I have adobe flash professional cc development tool , let me know whether I have to go with other development tool???
    your reply will  increase my confidential level
    please anyone can help me to solve this problem
    Thanks&regards
    Niranjan

    Adobe Flash Professional CC manual
    1) Create new project
    2) Configure your Project properties
    3) Embed runtime, so you users can use Adobe AIR without pre-installed Adobe AIR runtime
    4) After publishing you will receive %APP_NAME%.app folder that contain your project files

  • How to bundle a .FLA and multiple .SWF files in one .EXE?

    Hi,
    I have a .FLA file which uses loadMovieNum() to load various
    .SWF files when each one is called by the user clicking on a
    button. Each .SWF file also uses loadMovieNum() to call a second
    .SWF file. When I publish the .FLA file as a .SWF file it all works
    beautifully.
    Now I need to package the entire project into a Windows
    projector .EXE file for offline use on a computer without the Flash
    Player. When I publish the main .FLA file as a .EXE file, the .SWF
    files still load, although they blink before fully loading and
    displaying steadily.
    What I would really like to do is to bundle all the .SWF
    files into the .EXE file so when I send the finished project to the
    end user, they only have to deal with one file, rather than a
    folder with the .EXE file and multiple .SWF files.
    Is there a way to do this?
    I am using Flash 8 Professional.
    Thanks,
    Cam

    Since this isn't going to be web-based, why not include all
    the external swf files into the same Flash file and then use
    attachMovie?
    This will allow you to create one .exe file that would
    contain EVERYTHING. Since you aren't worried about loading speeds,
    you don't have to load the movie clips, but can simply create one
    large Flash file.

  • Flash CC Publish Air for Desktop for Windows from a Mac?

    I've been trying to figure out how to publish my game for windows and it is driving me nuts. On the adobe help page it says there should be a checkbox right below the "output as" boxes. It should say "Windows InstallerSelect this option to compile a native, platform specific Windows installer (.exe) instead of a platform-independent AIR installer (.air)." On my publish settings however, this is missing. Does anyone know how I can publish a windows .exe from Flash CC on my mac?

    Hi,
    Air for Desktop settings are platfrom specific , you couldn't publish the Windows.exe from MAC , you can publish the windows installer from windows machine .
    Thanks!

  • I just got the macbook air for christmas and i also got the dr dre headphones so i am trying to enable my soundcheck on my iTunes but i cannot figure out how to find where sound check is located can someone please help!!

    i just got the macbook air for christmas and i also got the dr dre headphones so i am trying to enable my soundcheck on my iTunes but i cannot figure out how to find where sound check is located can someone please help!!

    Go to the iTunes menu > Preferences > Playback.

  • HT5163 is there any difference in packaging of ipad air for india and other countries because i've not gotten a sim eject tool for my IPAD AIR? Plz help.

    Is there any difference in packaging of IPAD AIR for INDIA and other countries?
    because i didn't get any sim eject tool in IPAD AIR box.

    I believe it does vary depending on country.  A paper clip works equally well, so I wouldn't get too upset.

  • TS3276 I have no sound on my MacBook Air for sending and receiving messages. All sound settings have been checked and are OK. This problem has arisen many times and is intermittent in the sense that the sound returns and disappears for no apparent reason.

    I have no sound on my MacBook Air for sending and receiving messages. All sound settings have been checked and are OK. This problem has arisen many times and is intermittent in the sense that the sound returns and disappears for no apparent reason.

    Open System Preferences > Sound > Sound Effects
    Select:  Play user interface sound effects
    And make sure the Mute box is not selected.
    Now open Mail. From the Mail menu bar clik Mail > Preferences then select the General tab.
    Make a selection from the:  New messages sound  pop up menu.

  • Skype for desktop and voice messaging

    I am TRYING to download skype for desktop and the file is corrupted.  Also, how the HE** do I set up my voicemail.  I don't have a toolbar at the top of the screen, which is why I TRIED to download skuype for desktop in the first place.  IPO.

    Try to install the currently latest Skype 7.4.0.102 desktop version using this installer:
    http://download.skype.com/msi/SkypeSetup_7.4.0.102.msi

  • I got an 11 inch macbook air for christmas and now i am regretting not getting the 13 inch is there any way i can upgrade to the 13 inch still ?

    i got an 11 inch macbook air for christmas and now i am regretting not getting the 13 inch is there any way i can upgrade to the 13 inch still ?

    okay well another question the track pad on my 11 inch mac got stuck and wouldnt work and i took it to the apple store and had a tech look at it and he said it was working and i got home and it still wouldnt work so i took it back again to another tech and he said the guy before didnt fix it right and he said it was broken and that i needed a new track pad and he said he would replace it but they didnt have any trackpads in the store at the time but he fixed it enough that it barely works but he said i needed to come back to get a new trackpad because he fixed it enough that it would only work for a short period of time, so i went back the other day to another tech and told him and he said that since it still works they wouldnt do anything about it. but it barely works and barely clicks down should they fix it since the one tech told me it will only work for a short time and that if i came back they would replace my trackpad ? i have apple care and i am still under the 1 year warranty.

  • HT5622 I sent my Mac Pro Air for repairs and for some reason my user and group password was changed to Apple and I can't figure out what the password is -.help please.

    Sent my Mac Pro Air  for repairs and when it came back I had to download many programs.  Dowloaded  the OS X Mavericks but now it tells me I need an application to install it in my computer.  Which application do I need? Checked the App store but am new at this and have no clue.

    Did they also restore your original user account? Log out of Apple and see if yours is there to log in to.
    You'll need to post the actual error message, not what you think it said. I don't think I've ever seen an error that said I needed an application to install anything on my Mac.

  • I just got an macbook air for christmas and i can't seem to find pages, keynote, and numbers. when my mom got the macbook the guy she bought it from said it came with those applications, how do i locate them?

    i just got an macbook air for christmas and i can't seem to find pages, keynote, and numbers. when my mom got the macbook the guy she bought it from said it came with those applications, how do i locate them? please help

    Apple - Up-to-Date Program for Pages, Numbers, and Keynote
    iWork and iLife for Mac come free with every new Mac purchase. Existing users running Mavericks can update their apps for free from the Mac App Store℠. iWork and iLife for iOS are available for free from the App Store℠ for any new device running iOS 7, and are also available as free updates for existing users. GarageBand for Mac and iOS are free for all OS X Mavericks and iOS 7 users. Additional GarageBand instruments and sounds are available for a one-time in-app purchase of $4.99 for each platform.

  • Adobe Air for iOS and Android: FlasCC or Native Extension?

    Hi all,
    Who know - what provide better perfomance. FlasCC or Native Extension? For example for Math calculations, bitmapdata modification and etc.

    Well nothing prevent you from mixing flascc with native extension.
    Also, I think that you can also use domain memory in AS3 with the Bytearray class (not sure about that).
    Flascc vs normal as3 is mostly a question of language (portability) Do you want to write as3 or c++?
    Native extension give you speed and native platform access(platform specific feature).
    So, you should think about it this way:
    AS3, run in flash and air. Is sandboxed. Can use domain memory, but it's a bit harder to leverage than flascc.
    Flascc, run in flash and air. Is sandboxed, Can use domain memory. Give you the potential of leveraging the hundreds of opensources lib already out there.
    Native extension, run ONLY in air. Is not sandboxed. Native memory management. Also let you leverage the c++ lib. 
    The best (in my opinion) is to write native code for mobile and desktop (no air or flascc involve) and use flascc for the flash/web platform. It's harder, because you have write portable native code (lots of abstraction), but you mostly have the same problem with native extension.

  • Workers in AIR for desktop

    My question here specific to AIR apps for desktop, not for the web. I have Flex 4.6 and AIR 3.5. I've beed Googling for days with no joy.
    There are no code errors but does anyone know where and how to initialize workers in the main mxml file or hat appliaction handler should be used to get the worker thread to set the mainToWorker and workerToMain MessageChannel's, as there is no class initializer like there is in web flex projects.
    if(Worker.current.isPrimordial){
                                                      worker = WorkerDomain.current.createWorker(this.loaderInfo.bytes);
                                                      mainToWorker = Worker.current.createMessageChannel(worker);
                                                      workerToMain = worker.createMessageChannel(Worker.current);
                                                      worker.setSharedProperty("mainToWorker", mainToWorker);
                                                      worker.setSharedProperty("workerToMain", workerToMain);
                                                      workerToMain.addEventListener(Event.CHANNEL_MESSAGE, onWorkerToMain);
                                                      worker.start();
                                            }else{
         // if in worker thread
                                                      mainToWorker = Worker.current.getSharedProperty("mainToWorker");
                                                      workerToMain = Worker.current.getSharedProperty("workerToMain");
                                                      mainToWorker.addEventListener(Event.CHANNEL_MESSAGE, onMainToWorker);
    Cheers,
    Nige

    1.Make sure you understand the big differences between video and stagevideo, its tempting to think that stagevideo is the better videosoultion in any case, but its not.
    The best Article (however a little outdated) on the subject is imo: http://www.adobe.com/devnet/flashplayer/articles/stage_video.html
    2.In a performance heavy environment the combination stageVideo+greensock might not be the optimal solution, if you have time to reprogram Starling/feathers will probably give you a much better performing combination:
    http://forum.starling-framework.org/topic/stagevideo-with-starling-example
    3.I don`t know how you encode your Backgroundvideo, there are literally dozens of viable codecs that should differ extremly in how they stress the gpu/cpu. Maybe you have to experiment with a lower than HD resoultion and see if scaling up the background is a good compromise.

  • Worst performance of AIR for Desktop on PC

    Hi,
    I've been using AIR for mostly developing Android projects for my clients recently. And so far it's been pretty good for that.
    I have noticed before and specifically with my current project, which is also simple branded Android app for a client, the performence of AIR on Desktop is worst of all my Android devices. When testing the app on PC, (ctrl + enter in Flash Pro) when simple animations starts, AIR takes 100% CPU on all cores on my i5 Dell with Intel HD4000 and Nvidia GF630M.
    I was expecting it to run supper smooth on PC, while surprisingly, the app performs smooth on almost 3 years old Samsung Galaxy S2, then Galaxy Tab2, then chinese tab, and lastly comes PC, performace wise. For mobile, I have set the app to use GPU, and while testing on PC, I have tried all the "Render mode" options, but performance is exactly same.
    I am not using Stage3D/Starling. It's just classic Flash, with timeline animations, and AS3 document class to make it all interactive.
    Is it a must to use Stage3D/Starling combo to get same performance as on mobile, even for classic timeline style apps?
    I thought Flash was getting improved on PC the most, but it feels like other way around :/
    // chall3ng3r //

    Yes, I have tried debug and regular test, no diffirence.
    I have noticed that as three timeline animations stop one by one (they are not too big graphically, it's just a slot machine app), performance gets better. But, still not compareable to GSG2. I'm not using any filters, I did applied the motion-blur in Photoshop in alternate gfx, and just use that when in running state.
    Edit: also, i've tried with latest beta build, and latest release build. it's same.
    // chall3ng3r //

Maybe you are looking for

  • Sharepoint 2013 search broken after upgrade from 2013 foundation to 2013 ent.

    Hello I have tried many of the suggestions that I have found in the forums for this issue but non have worked as of yet. I have sharepoint 2013  sp1 running on server 2012 R2 connected to SQL 2012 DB, which was upgrade from SharePoint foundation 2013

  • Repairing Adobe Photoshop Elements 6 using program disk

    My computer (Windows XP) can no longer use the scanner (Cannon PIXMA MP780) to import photos to Element 6 because it can't find the CNCSCM60.DLL file in D:\Windows\system. When I use my program disk to reinstall or repair Elements, the screen display

  • Webdynpro and eventing from team viewer

    Hi. We are trying to add new fields to the MSS "General Data" iView (com.sap.pct.hcm.eeprofilegeneraldata.par) and are considering the following approaches: 1.) Write additional java code to retrieve the data we need and display it on the iview. 2.)

  • XSL mapping of ARTMAS IDoc - carriage returns and white space

    Hi all. I have tried all sorts here and am completely stuck. I am mapping an article master ARTMAS IDoc using XSL mapping and an extra carriage return and white space characters are being added to the FIELD1 and FIELD2 fields of the E1BPE1MARAEXTRT s

  • Jre1.5.0 doesn't work properly on Linux Debian

    Hi to everybody. I've tried today the jre1.5.0 on my Linux Debian, with the browser Firefox. I've found two problems, that i don't have with the jre1.4.2: 1) when it's open a new window by an applet java, I can't close the window clicking on the "x"