Announcements
The Scaleform forum is now read-only. Please head to the Gamedev site for product support.
Scaleform Forum (Read Only)
Scaleform enables developers to leverage the power of the Adobe® Flash® tool set to create powerful user interface environments for video games.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Scaleform on Unity - URLLoader bug on Android?

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
757 Views, 9 Replies

Scaleform on Unity - URLLoader bug on Android?

The code below works on iOS and standalone Mac/PC, but not Android. I'm guessing this is a bug where the URLLoader implementation for ADK doesn't fully handle the .apk/.jar Android app package format:

 
var url:URLRequest = new URLRequest("deleteme.txt");
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, function(e:Event):void
{
trace("loaded it", loader.dataFormat);
var foo:String = loader.data.toString();
trace("loaded:", foo);
});
loader.load(url);


deleteme.txt is a text file that lives in the same directory as the loaded .swf, in Assets/StreamingAssets folder. It appears that the loader in the function above is returning the actual bytes of the .swf itself (i.e. that "CWS..." swf file format header), and not the file I'm telling it to load.

Please advise. For now I'm having to do the loading with Unity's WWW class.
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: Anonymous

As a side note, Scaleform's trace handling in Unity throws an exception if I try to trace that statement this way, without first calling .toString() and saving it in a temp variable:

trace("loaded: ", loader.data);
Message 3 of 10
MatthewDoyleArt
in reply to: Anonymous

Thanks for reporting this. We will investigate the issue. When you say this doesn't work on Android - how do you mean exactly? How are you running this? On an Android device? I'll need more specific details to be able to reproduce your issue.

Matthew Doyle
Technical Marketing Manager

-----------------------------

Area Blog: Game Dev Blog
Watch me on Youtube: Youtube.com/MatthewDoyleArt
Check out some of my work at: MatthewDoyle.com
Message 4 of 10
MatthewDoyleArt
in reply to: Anonymous

FYI - I can confirm this is a bug. Our team is taking a look at this issue.

Matthew Doyle
Technical Marketing Manager

-----------------------------

Area Blog: Game Dev Blog
Watch me on Youtube: Youtube.com/MatthewDoyleArt
Check out some of my work at: MatthewDoyle.com
Message 5 of 10
MatthewDoyleArt
in reply to: Anonymous

This is as designed.

Matthew Doyle
Technical Marketing Manager

-----------------------------

Area Blog: Game Dev Blog
Watch me on Youtube: Youtube.com/MatthewDoyleArt
Check out some of my work at: MatthewDoyle.com
Message 6 of 10
andyBP
in reply to: Anonymous

Has this issue been fixed?

 

I noticed on the build notes for scaleform/unity that an issue similar to this had been resolved but we are experiencing a crash on android devices whenever we try to use the load method of a Loader Object.

 

If not does anyone have a workaround for this problem?

Message 7 of 10
adam.petrone
in reply to: andyBP

Hello Andy,

 

I just tested the actionscript code from the OP in our latest March release and this works as expected (no crash, text loads). As part of an APK, this should be just fine. OBBs are another story.

 

If you're not on the latest March release, I would suggest making a backup and try to upgrade.

There's a brief upgrade guide here: Unity Update Guide

 

If upgrading doesn't solve the problem, would you mind posting a snippet that I could use to try and replicate the crash with?

 

Thanks,

Adam

Message 8 of 10
andyBP
in reply to: adam.petrone

Hi Adam, thanks for your reply.

 

We have a half win after installing the newest (March 2014) version of Scaleform, the app no longer crashes on device when using the load method of the Loader object, but neither does it actually load the image. I am able to catch an error however and will investigate this issue further.

Message 9 of 10
andyBP
in reply to: adam.petrone

After finding a bit of time to investigate the error message, it is as follows: "Error reading " and then the filename. The file is a jpg, and is being loading from the sd card, I have verified that it does exists in the url it is attempting to load.

 

Any ideas would be appreciated.

Message 10 of 10
adam.petrone
in reply to: andyBP

The file is a jpg, and is being loading from the sd card

 

This is a known issue. At the moment, we only support loading files from the .apk. We're discussing potential solutions needed to include other directories and .obb archives.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report