Highlighted

How to load external SWF on iOS

New Here ,
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

439

Likes

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

How to load external SWF on iOS

New Here ,
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

440

Likes

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
Nov 17, 2019 0
Enthusiast ,
Nov 17, 2019

Copy link to clipboard

Copied

Likes

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
Reply
Loading...
Nov 17, 2019 0
New Here ,
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.

Likes

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
Reply
Loading...
Nov 19, 2019 0
Engaged ,
Nov 20, 2019

Copy link to clipboard

Copied

I've always used the File.applicationStorageDirectory folder for downloads and never had any problem on iOS.

Likes

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
Reply
Loading...
Nov 20, 2019 0
New Here ,
Nov 21, 2019

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Nov 21, 2019 0
Engaged ,
Nov 23, 2019

Copy link to clipboard

Copied

Did you copy the downloaded file off the device to check that it is the correct file?

Likes

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
Reply
Loading...
Nov 23, 2019 0
New Here ,
Nov 24, 2019

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Nov 24, 2019 0
Engaged ,
Nov 25, 2019

Copy link to clipboard

Copied

Does it work if you download the sound and image files directly i.e. not in a zip file?

How are you unzipping the zip file?

Likes

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
Reply
Loading...
Nov 25, 2019 0