Load local image display in air app

I am trying to load an image from the local file system, then diplay it in my air window. I don't have any problems getting the file reference from the open file dialog, problem is that I don't know what to do then. Somebody on another forum suggested using Loader.load to open the file using file.url as the URLRequest. This hasn't worked for me at all and I can't find any place online that explains how to do this. Thanks for the help

Try this:
var loader:Loader;
var file:File = new File();
var imagesFilter:FileFilter = new FileFilter("Images", "*.jpg;*.jpeg;*.gif;*.png");
file.browseForOpen("Open file", [imagesFilter]);
file.addEventListener(Event.SELECT, imgSelected);
function imgSelected(event:Event):void
    loader = new Loader();
    var urlReq:URLRequest = new URLRequest(file.url);
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
    loader.load(urlReq);
function imgLoaded(event:Event):void
    var bmp:Bitmap = new Bitmap();
    bmp = loader.content as Bitmap;
    addChild(bmp);

Similar Messages

  • Air 3.4 breaks loading local images (Mac OS X)

    Since updating to Air 3.4, my Air app no longer displays local images. Is this a known issue? If so what is the fix?
    I'm using the 'mx.image' component to dynamically display an image specified by the user. The image components 'source' property is set to the specified file's 'url' property. Image is displayed as a broken image icon. Was working until the 3.4 update.
    Adobe AIR version: 3.4.0.2540.
    Mac OS X 10.6.8. On Windows 7 the issue does not occur.
    Adobe Flash Builder 4.0.1
    Flex SDK 4.1
    Thanks for any info!
    - Felix

    Hi Chris,
    thanks for the response. I'm currently making a simplified repro case.
    It's hard to debug, since the problem does not occur in Flash Builder debug mode, only when publishing and running with AIR 3.4. Is there a way to make the FB debugger run using AIR 3.4, without updating Flash Builder and the Flex SDK?
    - Felix

  • How to divide and load parts of Large Adobe AIR app for Android

    Hi!
    I want to create an app for Android but it will quite large. It will be larger than the 50MB offered by Google Play Store. This means that I need to find a way and break the app and load parts of it when I need them. Imagine it like minigames inside a bigger app.
    It is not clear to me how to achieve this since every time on AIR, I can export and APK file for a mini-game let's say. Can I later download APKs and integrate them into my main app? How would this be possible? Another question that I have is: In order for a SWF to play on my app, it needs to be built by AIR for Android?
    The best case would be to download content from In-App purchases and integrate in my app.
    But these things are not so clear.
    Thanks in advance for your help and support.

    I don't know how your application is structured, but if you can split sections off into separate SWFs(plain AS3 document) then you could host those section SWFs online and require the user to download them on first run.
    You could use the FileReference object to download the SWFs, save them to the File.applicationStorageDirectory, and then display/load them up with the Loader object when needed from the app storage directory. You would possibly need to check to see if the files are present at every boot of the app though as a user could "Clear Data" or "Clear Cache" of the app in the Settings of their device and one or both of those could/would delete the downloaded files.
    FileReference - Adobe ActionScript® 3 (AS3 ) API Reference

  • 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

  • Loading and download SWFs for AIR apps on iOS from server

    Dear
    I develop app for ios using adobe air i need to loading and download swf in my server to my local device
    i make it loading from server and play but i need to download it locally in device to play offline
    Please Help
    Thank You

    If I undestand correct, the unload() is unsuported yet, so it just hangs in the memory
    In the tests I did, when I put two loads for the same swf, the app freezes, so I don´t know what you can do there.
    For the "code", you just need to put the LoaderContext on the loads, something like this:
    Frame 1:
    var myLoader:Loader;
    var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
    if(myLoader == null){myLoader = new Loader(); addChild(myLoader); }
    else {myLoader.unload();}
    Frame 2:
    myLoader.unload();
    myLoader.load(new URLRequest("file1.swf"),loaderContext);
    Frame 3:
    myLoader.unload();
    myLoader.load(new URLRequest("file2.swf"),loaderContext);
    Frame 4:
    myLoader.unload();
    myLoader.load(new URLRequest("file3.swf"),loaderContext);
    Regards,
    Rogério Gonzalez

  • Loading local images into HTML component

    I need to intermix text and images for a project I'm working
    on, and using htmlText seems the best way to do it. However, I
    can't get it to work when the images are loaded from the local file
    system.
    It seems to work fine with remote images:
    <mx:HTML x="480" y="191" width="256" height="315">
    <mx:htmlText>
    <![CDATA[
    <p>Image: <img src='
    http://knight.fb.hive7.com/res/img/ico/x32/coin.gif'
    ></p>
    ]]>
    </mx:htmlText>
    </mx:HTML>
    But not with local images:
    <mx:HTML x="480" y="191" width="256" height="315">
    <mx:htmlText>
    <![CDATA[
    <p>Image: <img src='../assets/coin.gif'
    ></p>
    ]]>
    </mx:htmlText>
    </mx:HTML>
    Anybody have any ideas or workarounds?

    Hi,
    I tried your solution, it did not worked, it gave me following error -
    ==========
    ReferenceError: Error #1056: Cannot create property placeLoadStringContentInApplicationSandbox on mx.core.FlexHTMLLoader.
        at com.exa.view::TestView/changeEvt()[/home/sachin/workspace/newed/src/com/exa/view/TestView .mxml:70]
        at com.exa.view::TestView/__toctree_change()[/home/sachin/workspace/newed/src/com/exa/view/T estView.mxml:89]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.3.0\frameworks\projects\framework\src \mx\core\UIComponent.as:9308]
        at mx.controls.listClasses::ListBase/mouseUpHandler()[C:\autobuild\3.3.0\frameworks\projects \framework\src\mx\controls\listClasses\ListBase.as:8989]
        at mx.controls::List/mouseUpHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\m x\controls\List.as:2279]
        at mx.controls::Tree/mouseUpHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\m x\controls\Tree.as:2952]
    ===========
    Here is the code, the function gets called on change event of a tree component(not shown in code here)
    ===============
    <mx:Panel width= "70%" height="100%" id="cpanel" paddingBottom="10" paddingLeft="20" paddingTop ="20">
            <mx:HTML id="htmlc" width="100%" height = "100%">
            </mx:HTML>
        </mx:Panel>
    <mx:Script>
        <![CDATA[
              public function changeEvt(event:Event):void{
                   htmlc.htmlLoader.placeLoadStringContentInApplicationSandbox = true;
                   htmlc.htmlLoader.loadString(rh.content.replace(/src="\/images/mg,'src="assets'));
        ]]>
    </mx:Script>
    ================
    It would be helpful if you give more insight on your html component.
    Adobe air -version - 1.5
    Thanks

  • Safari 7.1 won't load large images on MacBook Air. Turning off Auto Graphics is not an option.

    When I try to load a large image with Safari 7.1, I get a black box instead of an image.
    Chrome and Firefox load the image just fine.
    This is a known problem and others have resolved it by turning off Auto Graphics Switching.
    However, my version of MacBook does not have the capability to turn off Auto Graphics Switching under the Energy Saver preferences. (I guess I have the GPU or chip or whatever that doesn't provide that option.)
    Are there any workarounds?
    Here are two threads about the same problem, but the solutions don't work for me:
    safari 7 won´t load large images...
    Safari 7.0.1 does not load large images

    Safari > Preference > Advanced
    Checkmark the box for "Show Develop menu in menu bar".
    "Develop" menu will appear in the Safari menu bar
    Enable Images.
    Make sure that"Disable Images" is not enabled.
    Best.

  • Image displays in CS4 Apps differently

    I have a gs tif file that I converted to cmyk. In PS the cmyk version looks virtually identical on screen to the gs version although when you hold the eyedropper over the image, cyan displays as a higher percentage than m or y, with k lowest. In Bridge the cmyk version clearly show with a cyan cast.
    Color settings are synchronized in CS4.
    Can anyone tell me why: 1, the images are displaying differently, and, 2. using Convert To Profile, cymk, Working CMYK US Sheetfed Coated v2, image appears to have a distince cyan cast?
    Thanks in advance
    J

    the images are displaying differently
    Have you proofing enabled in both of them? Even if the profiles match otehrwise, that option still has to be toggled.
    image appears to have a distince cyan cast?
    Well, if you print CMYK, you want "rich black", which means that it needs to be underprinted with another color to not look like a dull gray. Only spot black/ text black does not require that. That's not the point here, though. It's really due to the conversion being done wrong. If you really want to retain the blacks as a pure channel, use the method described. Also, if you can, in the future simply start out in CMYK to avoid these issues.
    Mylenium

  • Load local image file to database on web

    Read_image_file works fine in client side. but it does not work on the web, can somebody find the way to save image from image file in client PC to Oracle database (or to webserver directory) when run on web.
    Thanks
    Frank
    null

    You may find the following articles useful for the JSP/Servlet part:
    Uploading files: http://balusc.blogspot.com/2007/11/multipartfilter.html
    Downloading files: http://balusc.blogspot.com/2007/07/fileservlet.html

  • Problem in a Spark List with local images dragMoveEnabled in a AIR 2 application...

    Hey,
    I developpe an AIR 2 application which allows user to load local images in a list. My list is dragEnabled, dropEnabled and dragMoveEnabled to change the order of the images. But when I'm trying to move an itemRenderer, my application crash with a " Security SandBox Violation ".
    Please help me how to fix it.
    Thanks
    Paul

    Can you embed the assets in the data provider?
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   initialize="init();">
        <fx:Declarations>
            <s:ArrayCollection id="slideArrayCollection" />
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                [Embed("accept.png")]
                protected const Img1:Class;
                [Embed("add.png")]
                protected const Img2:Class;
                [Embed("anchor.png")]
                protected const Img3:Class;
                [Embed("application_add.png")]
                protected const Img4:Class;
                [Embed("application.png")]
                protected const Img5:Class;
                protected function init():void {
                    slideArrayCollection.addItem({label:"Accept", thumbPath:Img1});
                    slideArrayCollection.addItem({label:"Add", thumbPath:Img2});
                    slideArrayCollection.addItem({label:"Anchor", thumbPath:Img3});
                    slideArrayCollection.addItem({label:"Application Add", thumbPath:Img4});
                    slideArrayCollection.addItem({label:"Application", thumbPath:Img5});
            ]]>
        </fx:Script>
        <s:List id="thumbList" useVirtualLayout="false"
                itemRenderer="ThumbTrayListItem"
                dataProvider="{slideArrayCollection}"
                height="150" width="200">
            <s:layout>
                <s:HorizontalLayout columnWidth="150" gap="15" paddingRight="5" variableColumnWidth="false"/>
            </s:layout>
        </s:List>
    </s:Application>
    Peter

  • Help With Loading an Image In AIR

    I need to load an image (GIF) with AIR using File and FileStream, but can't figure out how to do it. I need to load the image into a Bitmap or BitmapData object, so I can't use the loader class. Here's what I have so far:
    import flash.display.*;
    import flash.events.*;
    import flash.filesytem.*;
    import flash.net.FileFilter;
    import flash.utils.ByteArray;
    import flash.geom.Rectangle;
    var file:File = File.documentsDirectory;
    var myImage:BitmapData;
    var myFilter:FileFilter = new FileFilter("GIF Image","*.gif");
    file.addEventListener(Event.SELECT,loadImage);
    file.browseForOpen("Open",[myFilter]);
    function loadImage(e:Event):void{
    var stream:FileStream = new FileStream();
    stream.open(file,FileMode.READ);
    var bytes:ByteArray = new ByteArray();
    stream.readBytes(bytes);
    stream.close();
    //By the way, this image is a special format and will always be 160 by 160 pixels.
    myImage = new BitmapData(160,160);
    bytes.position = 0;
    myImage.setPixels(new Rectangle(0,0,160,160),bytes);
    addChild(new Bitmap(myImage));
    However, this never works. I always get this error:
    Error #2030: End of file was encountered.
    I don't quite understand why. Help would be much appreciated.

    I already know how to do that, but I specifically stated in my post that I can't use the Loader class. The reason for that is that my program is an image manipulation program, and I need to load the data into a BitmapData object. However, since I originally made my post, I have found some more information. I used trace() to find out the length of the ByteArray I was loading the data into, and then the position after trying to create the BitmapData object, like so:
    import flash.display.*;
    import flash.events.*;
    import flash.filesytem.*;
    import flash.net.FileFilter;
    import flash.utils.ByteArray;
    import flash.geom.Rectangle;
    import flash.errors.EOFError;
    var file:File = File.documentsDirectory;
    var myImage:BitmapData;
    var myFilter:FileFilter = new FileFilter("GIF Image","*.gif");
    file.addEventListener(Event.SELECT,loadImage);
    file.browseForOpen("Open",[myFilter]);
    function loadImage(e:Event):void{
         var stream:FileStream = new FileStream();
         stream.open(file,FileMode.READ);
         var bytes:ByteArray = new ByteArray();
         stream.readBytes(bytes);
         stream.close();
         trace(bytes.length); //Outputs: 4631
         //By the way, this image is a special format and will always be 160 by 160 pixels.
         myImage = new BitmapData(160,160);
         bytes.position = 0;
         try{
              myImage.setPixels(new Rectangle(0,0,160,160),bytes);
         } catch(e:EOFError){
              trace(bytes.position); //Outputs: 4628
         addChild(new Bitmap(myImage));
    As the comments show, though the ByteArray is 4631 bytes, it is only read up until byte number 4628. Then it throws an error. Any idea what's going on?

  • Local image load and edit

    Hello,
    I already spend 2 days on this problem. I want to load local
    image into AIR application, edit and save as a new image. I know
    there are some security issues, which don't allow Loader class to
    access data on different domains than SWF file, but does it affect
    AIR too and local files editing? Well, sympthoms are the same.
    Here is the code:
    //pointing to an image
    var imageFile:File =
    File.documentsDirectory.resolvePath('someimage.png');
    //new file stream
    var fileStream: FileStream = new FileStream();
    fileStream.open(imageFile, FileMode.READ);
    //reading image into bytearray and closing stream
    var imgBytes: ByteArray = new ByteArray();
    fileStream.readBytes(imgBytes);
    fileStream.close();
    //tried to use LoaderContext and some workarounds available
    in the web - none is working
    //var loaderContext: LoaderContext = new LoaderContext();
    //loaderContext.checkPolicyFile=true;
    //loaderContext.allowLoadBytesCodeExecution = true;
    //creating loader and injecting image bytes into it
    var loader:Loader = new Loader();
    loader.loadBytes( imgBytes, loaderContext );
    //trace(loader.content); // will give you null
    //creating a sprite and adding image to it
    var somesprite:Sprite = new Sprite();
    somesprite.addChild(loader);
    //creating output file
    var myFile:File =
    File.documentsDirectory.resolvePath('newimage.png');
    var myFileStream:FileStream = new FileStream();
    myFileStream.openAsync(myFile, FileMode.WRITE);
    //Here is fun part: BitmapData capture everything in sprite
    except image
    var bd:BitmapData=new BitmapData(200,200);
    bd.draw(someSprite);
    var ba:ByteArray = PNGEncoder.encode(bd);
    myFileStream.writeBytes(ba);
    myFileStream.close();
    //However image will visible in the screen
    root.addChild(someSprite);
    Maybe somebody already noticed that issue and know the
    solution? It's not very sophisticated example - it won't let you do
    even a simple image editor. I'm sure there must be some way.
    Thanks in advance

    I think, then, that your problem is that you aren't waiting
    for the image to load before trying to encode and write it to disk.
    I tried your code snippet and could write the image once I put the
    encodeing and writing bit into an event handler that fired when the
    image finished loading.

  • Local videos not playing in Flash/Dreamweaver Air app

    Hi there. I am having trouble playing local video from an Air app created from Dreamweaver. I have found many similar [posts, but most are about Flex and so on. I need some help getting this working form Flash and Dreamweaver.
    What I did wat create a jQuery site that uses Flash to play videos. It will be packaged as a desktop Air app using the Dreamweaver Air plugin.
    From advice that I got here (http://soenkerohde.com/2008/06/playing-local-files-with-air/)
    I started a new Air Project in Flash as suggested. Using an Air flash app makes more sence I guess, but I still need to imbed it into an HTML framework.
    Here is the code I am using:
    import flash.filesystem.File;
    var myVideo:Video = new Video(stage.stageWidth, stage.stageHeight);
    addChild(myVideo);
    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    var client:Object = new Object();
    client.onMetaData = function(metadata:Object):void {
    trace(metadata.duration);
    ns.client = client;
    myVideo.attachNetStream(ns);
    var f:File = new File("Special_Assignment_Title.flv");
    ns.play(f.url);
    When I run this I get the following error:
    <blockquote cite="">ArgumentError: Error #2004: One of the parameters is invalid.
              at Error$/throwError()
              at flash.filesystem::File/set nativePath()
              at flash.filesystem::File()
              at videoPlayer_fla::MainTimeline/frame1()[videoPlayer_fla.MainTimeline::frame1:17]</blockquo te>
    Any suggestions on how to fix my problem? Any help would be greatly appreciated

    Instead of using the File object, try URLRequest instead:
                                            var urlReq:URLRequest = new URLRequest("Special_Assignment_Title.flv");
                                            ns.play(urlReq.url);
    Chris

  • AIR App Crashes iOS After Loading Remote Image

    I have had this problem both with the latest official AIR SDK 3.3 (3.3.0.3670) and 3.4 release (3.4.0.2540) when doing a Standard build.  I am loading a few files one after the other from a remote server on an iPad.  After loading some xmls and swfs successfully, my app crashes and closes without any error message upon loading an image file (I've tried both png and jpg with the same result).  I have both progress and complete event listeners on the loader and the crash happens after all bytes are loaded and before the complete event triggers.  So it seems as if there is some problem with initializing/decompressing the image.  The crash log reports things along the lines of "EXC_BAD_ACCESS" and "KERN_INVALID_ADDRESS."
    This problem does not occur if the files are loaded from the application directory --- only when they are loaded from the remote server.  It is also not occuring with the preview AIR SDK 3.4 with iOS6 Support release (3.4.0.3010).  It is also not occuring on the desktop simulator (adl) or the Fast mode debug option.
    Right now all I can gather is that it is a bug with the AIR SDK that seems to be resolved in upcoming versions, however I am due to submit my app to the app store September 4th so I don't really have the time to wait!
    Please advise on how I can go about tackling this issue.
    The issue occurs with any combination of the following:
    Flash Builder 4.6
    Flex SDK 4.5.1 or 4.6
    AIR SDK 3.3 or 3.4
    iPad 1/2/3 with iOS 5.1.1

    Hi,
    Could you please consider it raising via bugbase.adobe.com and share the bug number here for reference. Also, we would request you to attach sample source files which can replicate the issue.
    -Thanks for reporting it.
    Pahup

  • 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

Maybe you are looking for