Check for SWF / AIR

48 views
Skip to first unread message

Gcs_dev

unread,
Mar 19, 2013, 12:13:25 PM3/19/13
to haxe...@googlegroups.com
Is there any way for a class to check if it is part of an AIR application or a standard SWF? For example, to know whether or to use File as opposed to FileReference.

Mike Welsh

unread,
Mar 19, 2013, 3:59:43 PM3/19/13
to haxe...@googlegroups.com
You should be able to check flash.system.Capabilities.playerType -- I believe it will be "Desktop" for AIR apps.

Greg Dove

unread,
Mar 19, 2013, 4:08:30 PM3/19/13
to haxe...@googlegroups.com
Mike's suggestion seems to be a good one based on the docs. As an alternative, in the past I think I have also used system.Security.sandboxType:

if this value is "application" then it's AIR. 

Greg Dove
Dove Software Development Ltd
http://greg-dove.com


--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gcs_dev

unread,
Mar 20, 2013, 2:13:30 AM3/20/13
to haxe...@googlegroups.com
Excellent. Thank you both for your help. I'm going to try both solutions.
Reply all
Reply to author
Forward
0 new messages