Air app-storage swf network access

I have an swf file that is saved in the app-storage
directory, and it’s compiled with “allow network
access”, and it reads an xml file from a webserver.
When I load this file into an swfloader in my air app, it
throws up the “this file is trying to connect”
notification box.
Even if I add the path in the security settings, it refuses
to work.
Is there any way to let it communicate and read the xml file?

It should be the application directory, not the storage directory.

Similar Messages

  • Communicating between Air apps on local network?

    I am trying to build an AIR application that allows communication on a local network only.  Can I use the Local Connection to achieve this or is that only to communicate between apps on a single machine.  The functionality I am trying to achieve is simple check in/out app to let users know when someone is already working in a folder.   I already have the functionality built for this, I just need to be able to broadcast events to another AIR app on a local network.  Can anyone help or shot this down?  Thanks in advance.

    You are right: you can only use LocalConnection for communication between AIR applications (and SWF content in browsers) on a single machine.
    You may want to build a server application that the other AIR applications communicate with via a socket connection.

  • Air App Storage

    I'm new to Air and am trying to open an xml file via a FileStream object. The xml file (site.xml) is in the same directory where the .swf gets published and I've also included it in Settings>Include Files, but this produces a file not found when I test:
    var filestream:FileStream=new FileStream();
    filestream.addEventListener(Event.COMPLETE, onOpen);
    filestream.openAsync(new File("app-storage:/site.xml"), FileMode.READ);
    private function onOpen(e:Event):void {
         xml=XML(filestream.readUTFBytes(filestream.bytesAvailable));

    It should be the application directory, not the storage directory.

  • Launch desktop AIR app from swf button

    I have a very simple task. I have an AIR app installed. All I want to be able to do is launch it from a swf button. I am building the swf button in Flash CS6. How do I do this? All it has to do is launch the app. No fancy stuff, no installs, no validation. Just launch the darn app. I can't seem to find a simple solution. Thanks!

    Not sure exactly why yet, but I finally found something that worked!!!! Hope this saves someone else hours of research:
    myCustomBtn.addEventListener(MouseEvent.MOUSE_DOWN, versionDetectCallback);
    var _air:Object;
    var _loader:Loader;
    var appID:String = "thenameofmyapp";
    var pubID:String = " "; 
    function loadAir() : void
    _loader = new Loader();
    var loaderContext:LoaderContext = new LoaderContext();
    loaderContext.applicationDomain = ApplicationDomain.currentDomain;
    _loader.contentLoaderInfo.addEventListener(Event.INIT,onInit);
    _loader.load(new   URLRequest("http://airdownload.adobe.com/air/browserapi/air.swf"),loaderContext);
    function onInit(event:Event) : void
    _air = event.target.content;
            //the pubID argument resolves to and empty string ""  
            _air.getApplicationVersion(appID, pubID, versionDetectCallback);
    function versionDetectCallback(event:MouseEvent) : void
           _air.launchApplication(appID,pubID);
    loadAir();

  • Macbook Air app storage problem

    I have a 256gb Macbook Air with OS X Mavericks 10.9.5. Everything is running fine except that when I open up my storage information it says that apps are taking up 100gb of space, however, when I go to my finder > applications > get info it says that my applications are only taking up 11gb. I don't have much space left on my hard drive so this is a bit of an issue of me and also kind of confusing. How can I have 100gb of applications taking up space on my computer when I only have 11gb worth of applications?
    I only have the default applications and Google Chrome, Skype, uTorrent, Photoshop and Lightroom installed.
    Is there any way that I can reduce the gb spent on applications without deleting anything?
    Thank you!

       Re-index Macintosh HD.
       Spotlight reindexing will take a while to finish.
       System Preferences > Spotlight > Privacy
       http://support.apple.com/kb/ht2409
       You will see a new category  “Other” in the Storage Display.
          About “Other”:
       http://support.apple.com/en-us/HT202867
       Note:
       If Macintosh HD is not shown on the Desktop,  click on an empty spot on the Desktop to activate Finder.
       Finder > Preferences > Sidebar > Devices > Hard disks
       Enable it clicking inside box beside "Hard disks" to place a checkmark.
       Best.

  • AIR App, load externally hosted SWF which loads XML

    I am wondering if this is even possible, because I am getting error 2148. 
    I am loading in SWF files that are externally hosted into an AIR app.  Everything works great!
    Is it possible to have one  of these child SWFs load in some type of XML data or access an XML file on the desktop/tmp?
    Or if need be, should I have the AIR app do all the loading (including the other XML) and pass that to the child SWF?
    Thanks in advance!
    In detail:
    AIR app -> Loads SWFs
    SWFS -> Load XML
    SWF -> displays something or does something RAD!!!
    Stuff I have tried:
    Ive added an mms.cfg file in the proper places, as well as, changed my adobe security settings to allow access to a "tmp" folder on desktop. The loaded SWF from an external domain loads fine however it still shows an error 2148 when trying to access an XML file within the "tmp" folder on desktop. The SWF when published is also set to "access local files"

    I was able to find a workaround of the security sandbox using Loader.loadBytes();
    Aleksandar Andreev's Loader class really helped:
    http://blog.aleksandarandreev.com/?p=42

  • Bundled AIR App Can't Connect to Internet

    Hi,
    I have created a bundled AIR app that needs to access the internet. The Mac version of this app works fine behind our company proxy server, but the Windows version running on Windows 7 won't connect to the internet. I've configured IE's proxy settings correctly, so I do not know what else to try. Any ideas?
    thx

    Nervermind, it was another issue with how it was packaged... missing files.

  • Adobe Air and SharedObject in app-storage

    Hi there,
    I'm developing an air application that loads external swf files from the app-storage folder. In my external swf file I have to store a local object, but every time I try to flush (write) my object I get an error that the SharedObject can't be flushed.
    I assume that the Sandbox don't allow this?
    I searched the whole web but I found nothing that worked for me.
    Maybe it is possible to start (or install) the air application from the app-storage folder?
    many many thanks

    Ok, I've found a solution that worked for me. Loader.loadBytes did the job for me. I know that is not recommended but in my case I take control for the external swfs.

  • Loading external swf into Air App

    Hi All,
    I'm building an Adobe Air App for desktop and am having problems loading an external swf. Every time i try to load i get:
    SecurityError: Error #2070: Security sandbox violation........ cannot access Stage owned by app....blah blah
    The file that is being loaded is in a local directory, but as i understand its in a different 'sandbox' which is a security risk.
    Is there any way around this?!
    Any help would be much appreciated
    Many Thanks
    Matt

    that's why i added those comments about the swf's domain.  for locally loaded swfs, use:
    SFMltd wrote:
    Hi Kglad, Thanks for the Example.
    if i run my class with securityDomain = SecurityDomain.currentDomain; then it throws this error: SecurityError: Error #2142: Security sandbox violation: local SWF files cannot use the LoaderContext.securityDomain property.
    The swf file im trying to load is stored locally so i guess this error makes sense. However if i comment out that line i get the same "cannot access Stage owned by app" error?
    See below for class:
    package  {
      import flash.display.MovieClip;
      import flash.filesystem.File;
      import flash.events.Event;
      import flash.net.FileReference;
      import flash.events.MouseEvent;
      import flash.display.Loader;
      import flash.net.URLRequest;
      import flash.system.LoaderContext;
      import flash.system.ApplicationDomain;
      import flash.system.SecurityDomain;
      public class assetPreview extends MovieClip {
      private var loader:Loader;
      private var mainSWF:MovieClip = new MovieClip();
      public function assetPreview() {
      addEventListener(Event.ADDED_TO_STAGE, initialise);
      public function initialise(e:Event):void
      removeEventListener(Event.ADDED_TO_STAGE, initialise);
      var allowSWF:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain);
    // allowSWF.securityDomain = SecurityDomain.currentDomain;
      loader = new Loader();
      loader.load( new URLRequest(settingsXML.pathToSWF),allowSWF);
      loader.contentLoaderInfo.addEventListener(Event.COMPLETE, viewPreview);
      public function viewPreview(e:Event):void
      addChild(mainSWF);
      mainSWF.addChild(loader);

  • Can i share a storage directoy between two air apps?

    hi there... I'm developing my thesis in Flash CS4 AIR 1.1
    I have two applications, the main application and the administrator app...
    in the administrator app I can add files to the data base... I'm using the browse for open property... to save in the database an swf file
    if the user selects the swf file from a pen drive, it will save in the database that URL f:/swf_file/example.swf
    so, the main application when it starts looking for that URL, and there is not such url as f:/swf_file/example.swf, it will have an error
    i was wondering if i can have a app-storage directory for both apps.. so that when the user selects a file it will be copyTo the shared appStorage directory
    is it possible?

    You can have the same dir for both apps' storage directory.
    But you can figure out the other app's storage dir and use it.
    Or you can just use a common directory in Documents directory to share files.

  • How do I use transparent=true in my Air app but still displaying swf ?

    How do I use transparent=true in my Air app but still displaying swf's files ?
    The thing is that I created a customized chrome, and looks nice when it is transparent cause seems to be floating, it works as a browser, but the problem is that when I navigate with it into a page wich contains embedded youtube videos, as in example, or any other swf file... it just doesn't show...
    Any help ? thanks in advance,

    Contact iTunes Support: http://www.apple.com/support/itunes/contact/

  • Embedding swf files in AIR app for ios

    Hi,
    After going through a lot of articles already available, I found answers with varying views on the following questions:-
    1) Can we embed swf files using the embed tag in air app for ios, with symbols exported ?
    Something like [Embed(source="someSWF",symbol="exportedSymbol")]
    and also something like [Embed(source="someSWF")].
    From what I understand, one can't embed swf's with actionscript byte code in them. So exporting symbols actually creates class linkages which leads to creation of abc. But I'm unsure on this because some sources say otherwise.
    2) Can we embed swf files using embed tag in air app for ios, without symbols exported ?
    Something like [Embed(source="someSWF")]
    and also something like [Embed(source="someSWF" mimeType = "application/octet-stream")]
    I read somewhere else, that you can actually embed symbols separately by providing symbol tag in embed tag but not entire swf (which leads to uncompiled actionscript error) but not sure about this as this is contradictory to finding #1.
    3) If #2 is possible, then do embedding two different swfs with same symbol names would cause a conflict and result in #3747 error ?
    Please note I am not asking about the Loader class here but using the Embed keyword for embedding swfs.
    Also do the results differ with AIRSDK 3.8 and 3.9 and using different swf-version in compiler flags ?
    In our application we started getting error #3747 in class creation of one of the embedded swfs (like new EmbeddedClass()) when we changed from swf-version 17 to 21 using AIRSDK 3.8. So was this error not there earlier or it was there but swf-version was suppressing it ?
    Any help is much appreciated.
    Thanks!

    I am fairly sure that the answer to your questions is: “no”.
    For embed to work the AIR app would have to be working in interpreter mode, and that can work for local testing, but can’t work for submitting apps. An easy change for you to do would be to use SWCs instead of Embed. Other than that you’re looking at Loader, but also a tricky command line build of the app.

  • Embedding swf into HTML+JS AIR app

    Hi
    I'm trying to embed swf into HTML+JS AIR app with no luck.
    First, I created flash library with this class in default package.
    package
         import mx.controls.Alert;
         public class Utilities
              public function Utilities()
                             //asdfasdf              
                   Alert.show("asdasd","");
    Then I compiled the project with Flash Builder and got library.swc as result. Then I extracted swf file.
    After this is added required code into my html:
    <html>
    <head>
        <script type="text/javascript" src="AIRAliases.js"></script>
        <script type="text/javascript" src="AIRIntrospector.js"></script>
        <script type="text/javascript" src="jquery-1.6.2.js"></script>
        <script src="library.swf" type="application/x-shockwave-flash"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                alert('loaded');
                air.Introspector.logError("aaa");
                var v = new runtime.Utilities();
        </script>
    </head>
    <body>
    </body>
    </html>
    Then after I run application, I get error that result of expression is not constructor, function etc.
    Could you help me please?  Thanks in advance.
    Here is sample code:
    http://depositfiles.com/files/jztpnlb3a

    No. I mean that the Flex framework makes certain assumptions about the environment it is running in -- like having a stage to work with. The Alert function, for example, works by creating a sprite and adding it to the Flash display list. Since your embedded SWF is not on a stage, there's no way for it to work.
    You can can possibly use certain non-visual parts of the framework, such as the rpc package, but I can't guarantee it.

  • Embedding local .swf file in AIR app

    Hi all,
    I want to include a small Google Maps .swf file as part of my overall HTML based AIR application and I was wondering whether anyone here has had any success in achieving this. Currently, my set up looks like this:
    AIR xml file:
    <?xml version="1.0" encoding="utf-8" ?>
    <application xmlns="http://ns.adobe.com/air/application/1.5">
        <id>gmaps</id>
        <filename>gmaps</filename>
        <version>0.1</version>
        <initialWindow>
            <title>gmaps2</title>
            <content>gmaps2.html</content>
            <systemChrome>standard</systemChrome>
            <transparent>false</transparent>
            <visible>true</visible>
            <width>1200</width>
            <height>1000</height>
            <x>20</x>
            <y>20</y>
            <minimizable>true</minimizable>
            <maximizable>true</maximizable>
            <minSize>850 636</minSize>
            <resizable>true</resizable>
        </initialWindow>
    My gmaps2.html file:
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <title>GMAPS</title>
        </head>
        <body>
            <div id="map_canvas" name="map_canvas">
                <object
                  classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
                  width="800px"
                  height="600px">
                      <param name="movie" value="app:/flex/GMapsController.swf">
                      <param name="quality" value="high">
                      <param name="flashVars" value="key=CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CC">
                      <embed
                        width="800px"
                        height="600px"
                        src="app:/flex/GMapsController.swf"
                        quality="high"
                        flashVars="key=CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCC"
                        pluginspage="http://www.macromedia.com/go/getflashplayer"
                        type="application/x-shockwave-flash">
                </object>
              </div>
        </body>
    </html>
    My GMapsController.mxml file:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <maps:Map xmlns:maps="com.google.maps.*" id="map" mapevent_mapready="onMapReady(event)" width="100%" height="100%"
        url="http://my.domain.com" key="CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"/>
        <mx:Script>
            <![CDATA[
                import com.google.maps.LatLng;
                import com.google.maps.Map;
                import com.google.maps.MapEvent;
                import com.google.maps.MapType;
                private function onMapReady(event:Event):void {
                    this.map.setCenter(new LatLng(40.736072,-73.992062), 14, MapType.NORMAL_MAP_TYPE);
                public function setLocation(lat:Number, long:Number):void {
            ]]>
        </mx:Script>
    </mx:WindowedApplication>
    When I open my air app, I don't get any error messages and it appears that the swf is not loaded at all.
    When I switch my AIR .xml file to point to the GMapsController.swf file instead of the gmaps2.html file, it works perfectly - this gives me the impression that there's either:
    1. Something wrong with including a WindowedApplication in a HTML file.
    2. Something wrong with including a local .swf file in HTML based application.
    I've tried referencing the .swf file in the html file from a remote server with the following:
      <div id="map_canvas" name="map_canvas">
                 <object
                   classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
                   width="800px"
                   height="600px">
                       <param name="movie" value="app:/flex/GMapsController.swf">
                       <param name="quality" value="high">
                       <param name="flashVars" value="key=CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CC">
                       <embed
                         width="800px"
                         height="600px"
                         src="http://my.server.com/GMapsController.swf"
                         quality="high"
                         flashVars="key=CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCC"
                         pluginspage="http://www.macromedia.com/go/getflashplayer"
                         type="application/x-shockwave-flash">
                 </object>
               </div>
    but no luck with that.
    Any help would be greatly appreciated.
    Thanks
    Sean

    Brandon,
    Thanks for the link - I wasn't aware about the HTML Loader class and how it relates to loading Google Maps. I'm not using the HTML loader class though, so I'm not sure how it relates to the issue I'm having.
    I'm currently following the advice outlined at http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS4B441C24-BAE3-4110-91FD-A4E5EEFB2467.htm l where the SWF object is loaded through JavaScript, but I haven't had any luck with it yet. I'm pretty new to Flex/Flash/AIR applications - I'm starting to think it could be something simple wrong with my .mxml file:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <maps:Map xmlns:maps="com.google.maps.*" id="map" mapevent_mapready="onMapReady(event)" width="100%" height="100%"
        url="http://my.server.com" key="CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"/>
        <mx:Script>
            <![CDATA[
                import com.google.maps.LatLng;
                import com.google.maps.Map;
                import com.google.maps.MapEvent;
                import com.google.maps.MapType;
                private function onMapReady(event:Event):void {
                    this.map.setCenter(new LatLng(40.736072,-73.992062), 14, MapType.NORMAL_MAP_TYPE);
                public function setLocation(lat:Number, long:Number):void {
            ]]>
        </mx:Script>
    </mx:WindowedApplication>
    I've tried creating a different .mxml file from the code outlined http://www.mikechambers.com/blog/2007/11/07/air-example-native-drag-and-drop/ (just as an example), just to make sure that the problems I'm having are not related in any way to the Google Maps API for Flash. Even with this second .mxml file, I still haven't had any luck in getting the swf content to load locally from the HTML file. However, if I set the content element in the AIR .xml file to look like this:
    <content>DragAndDropExample.swf</content>
    ... it works as expected.
    So, this has started me thinking that you cannot include a .swf file which has a base tag of WindowedApplication in a HTML based application? Can anyone confirm that this thinking is correct?
    Has anyone here managed to load .swf content in a HTML based application using the code outlined at http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS4B441C24-BAE3-4110-91FD-A4E5EEFB2467.htm l?
    Thanks
    Sean

  • Will AEC ( Acoustic Echo Cancellation ) work in an SWF App that runs inside of an AIR app?

    Hi,
    I was forwarded here in hopes of better understanding the architecture of Flash Player within the AIR environment.
    1) Woulda SWF App compiled to target FP10.3 run in an AIR App that targets FP 9.0 and AIR 2.7?
    * Would FP10.3 specific features work correctly within the AIR app since all the work is happening in the SWF app?
    * Assumption: The user has AIR runtime 3.1 installed( which I assume embeds FP 11 )
    Details:
    * App #1 => is a swf app that targets FP10.3 + LCCS v2.2.0 ( FP 10.3 )
    * App #2 => AIR 2.7 app that target FP 9.0
    Execution Flow:
    * App #2 creates an HTML view, loads the "App #1" within itself and runs it.
    Will the App #1 have AEC working and/or any FP10.3 specific behavior ? Is it OK that the container AIR app is not be targeting FP10.3 ?
    Thanks,
    Alex G.
    PS Original post came from: http://forums.adobe.com/thread/927781

    This question would be better directed to the FlashPlayer and/or AIR forum.
    AIR embeds a version of WebKit to implement the HTML view and I am not sure of what FlashPlayer is used by that "browser" (it could be an embedded FlashPlayer, in which case I am assuming will be the same version of AIR FP, or the FlashPlayer installed at the OS / external browser level, in which case it could possibly be a newer version of the FlashPlayer).
    Best thing to do: try it out
    I would build an AIR app embedding a small SWF that prints out the FlashPlayer version and see what happen changing the targets for the AIR app and the SWF.

Maybe you are looking for