Skip navigation
bboldi
Currently Being Moderated

Error #2035 but only on MAC OS ??? why ?

Oct 18, 2009 5:28 AM

I have an application that displays swf files when user selects them with a file browse dialog. here is the code:

 

             private function dispDialog():void
            {
                var file:File = File.desktopDirectory;
                file.addEventListener(Event.SELECT,onFileOpen);
                file.browse(new Array(new FileFilter('SWF','*.swf')));
            }


            private var _instPath:String;
           
            private function onFileOpen(e:Event):void
            {
                _instPath = e.target.nativePath;
                verifyAnimation(e.target.nativePath);
            }


            private function verifyAnimation(path:String):void
            {
                vswfl = new SWFLoader();
               
                vswfl.addEventListener(Event.COMPLETE,onvSWFComplete);
                vswfl.addEventListener(IOErrorEvent.IO_ERROR,onvSwfLoadError);
                vswfl.load(path);
            }


            private function onvSWFComplete(e:Event):void
            {
               // ok

            }


            private function onvSwfLoadError(e:IOErrorEvent):void
            {
                Alert.show('error10006: This is not a valid b2a file! '+e.text,'error!',4,this);
            }

 

So when the user opens the application on Windows or Linux, everything is great, but when user has MAC OS X, the code displays error10006: This is not a valid b2a file! Error #2035

 

i think the code means  URL Not Found or something like that, but WHY only on MAC OS? And how can I fix this???

 

Thanks for your help in advance

 

it should work

 
Replies
  • Currently Being Moderated
    Oct 19, 2009 6:20 AM   in reply to bboldi

    You might be facing the same issues I had a while back when I was trying to load PDF files from the local filesystem. In my case, I was using HTMLLoader class, but maybe it's the same with SWFLoader (haven't tried myself). Anyway, in my case the fix was to check for if the user used OS X and if true, prepend "file://" to the url.

     

    var fileURL:String = File.applicationStorageDirectory.resolvePath("Help Documents/help.pdf").nativePath;
    if(flash.system.Capabilities.os.indexOf("Mac OS") > -1) fileURL = "file://"+fileURL;
    htmlLoader.load( new URLRequest(fileURL) );

     

    More info here:

    http://playground.deju.nu/2008/07/htmlloader-and-local-pdf-content/

     

    -Jens

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points