Skip to content

Instantly share code, notes, and snippets.

@marchbold
Last active July 31, 2016 02:23
Show Gist options
  • Save marchbold/61c6b39e2889c839a77d7085f1c68f61 to your computer and use it in GitHub Desktop.
Save marchbold/61c6b39e2889c839a77d7085f1c68f61 to your computer and use it in GitHub Desktop.
Mount an OBB expansion file using the ExpansionFiles ANE
var obbFile:ExpansionFile = new ExpansionFile( ExpansionFile.MAIN, 1001003, 93147195 );
if (ExpansionFiles.service.expansionFilesDelivered())
{
ExpansionFiles.service.obbUtils.addEventListener( OBBUtilsEvent.STATE_CHANGED, obbUtils_stateChangedHandler );
var success:Boolean = ExpansionFiles.service.obbUtils.mount( obbFile );
}
...
private function obbUtils_stateChangedHandler( event:OBBUtilsEvent ):void
{
trace( event.type + " : "+ ExpansionFiles.service.getFilenameForExpansionFile(event.file) );
if (event.state == OBBState.MOUNTED)
{
trace( "OBB file mounted" );
}
}
// com.distriqt.ExpansionFiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment