Question

I want to know, if my Flashapplication is running in a browser or it is tested from within Flash authoring tool (local Flashplayer).

I came up with this one.

var isLocal:Boolean = !ExternalInterface.available || ExternalInterface.call("window.location.toString") == null;

Other than stated in the AS3 documentation ExternalInterface.available returns always true when running in a browser or testing locally.

Was it helpful?

Solution

Try using Capabilities.playerType, it will return the type of runtime environment.

Link to the documentation here:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Capabilities.html#playerType

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top