Skip to main content
SIEM Ltd
Participant
November 17, 2019
Question

How to load external SWF on iOS

  • November 17, 2019
  • 3 replies
  • 782 views

Hello, 

we have an application that downloads content (various swf files as well as images and sounds) from the internet and stores them in the cache folder of the application. 

When we run the application on PC it runs correctly, when we try to run it on iPad, it fails to find the downloaded files (although we can see that they exist right after we have downloaded them).

Any solutions?

 

Thank you in advance.

This topic has been closed for replies.

3 replies

SIEM Ltd
SIEM LtdAuthor
Participant
November 24, 2019

Hello again and thanks for replying,

 

maybe I wasn't clear on my previous posts, but here is the case:

We have some swf and multimedia (sounds/images) files zipped on our server, we download the zipped file on iPad and unzip it on iPad (either on Cache, or on Storage directory). When we unzip this file, we can see that every file in it exists on iPad, however when we try to access them (i.e load a music file, or a swf file) we get the stream error exception.

The same code runs just fine on PC.

SIEM Ltd
SIEM LtdAuthor
Participant
November 21, 2019

We are still getting the same error (URL not Found) even if we use applicationStorageDirectory.

Inspiring
November 18, 2019
SIEM Ltd
SIEM LtdAuthor
Participant
November 19, 2019

Good evening,

First of all thanks for replaying, however we are aware of those article and we have taken them under consideration when we built our products. The problem still exists even if we use externalSWFs.txt as mentioned in the second article.

 

I don't remember if I mentioned that earlier, but we can download and unpack our swf files on iPad (File.cacheDirectory), but when we try to access them we get a file not found exception.

Below is some code that might help a bit:

 

var newPath:String = File.cacheDirectory.url + "/" + "Data/swf/main.swf";
var urlRequest:URLRequest = new URLRequest(newPath);

var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
urlRequest.cacheResponse = false;
urlRequest.useCache = false;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
loader.load(urlRequest, loaderContext);

 

The same code works fine on PC build. Is there any possibility (I don't think so) that we might have security issues because we are trying to access the cache?

 

Thank you in advance.