Return to Starling Playback Library

How to Embed GAF.zip?

Questions related to Starling playback library should be asked here.

How to Embed GAF.zip?

Postby dvrbear » October 20th, 2014, 1:48 am

How can i Embed the GAF.zip file to use it in my mobile application (with starling) ?

I think to add in package (apk/ipa) it is bad idea, but in example i have found just this:

var request: URLRequest = new URLRequest("GAF.zip");
var urlLoader: URLLoader = new URLLoader(request);
urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
urlLoader.addEventListener(Event.COMPLETE, this.onLoaded);

Thanks and sorry for my English )
User avatar
dvrbear
 
Posts: 26
Joined: October 20th, 2014, 1:42 am

Re: How to Embed GAF.zip?

Postby Ivan Avdeenko » October 20th, 2014, 6:18 am

Code: Select all
[Embed(source="../assets/GAF.zip", mimeType="application/octet-stream")]
private var GafZip: Class;

then write code below, i.e. in a constructor of a Starling root class:
Code: Select all
var gaf: ByteArray = new GafZip() as ByteArray;
var converter: ZipToGAFAssetConverter = new ZipToGAFAssetConverter();
converter.addEventListener(Event.COMPLETE, this.onConverted);
converter.addEventListener(ErrorEvent.ERROR, this.onError);
converter.convert(gaf);
User avatar
Ivan Avdeenko
 
Posts: 30
Joined: June 6th, 2014, 12:22 am

Re: How to Embed GAF.zip?

Postby dvrbear » October 21st, 2014, 7:50 am

It works!
Thanks alot!
User avatar
dvrbear
 
Posts: 26
Joined: October 20th, 2014, 1:42 am

Return to Starling Playback Library

Who is online

Users browsing this forum: No registered users and 1 guest