• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

How to load external SWF on iOS

New Here ,
Nov 17, 2019 Nov 17, 2019

Copy link to clipboard

Copied

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.

TOPICS
Development , How to , OS , Packaging , Product issue

Views

655

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 17, 2019 Nov 17, 2019

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 19, 2019 Nov 19, 2019

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 21, 2019 Nov 21, 2019

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 24, 2019 Nov 24, 2019

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines