Wednesday, November 20, 2013

Checking Permissions at runtime in AS3.

I started with the search term "Checking to see if using networking at runtime in as3"
... no luck.

For some reason I couldn't quite figure this out.
I wanted some way at runtime to query if my game was compiled with
the compiler option "Use Network Services" == true or == false.

Then I googled:
Checking Permissions at runtime in AS3.

For some reason... Not much luck here either.

Answer for what I needed:

import flash.system.Capabilities;

Correction... That was a bit hackish and didn't work... Fix:

import flash.system.Security;
if ( Security.REMOTE ) { return;}

Wait... what am I doing... that is a constant... Need sleep... Correction to previous:

if ( Security.sandboxType == Security.REMOTE ) { return;}

No comments:

Post a Comment