Package | air.system |
Class | public class License |
Inheritance | License EventDispatcher Object |
Language version: | ActionScript 3.0 |
Runtime version: | AIR 51 |
Note that this initially just loads in the information from a local file. If there is no local
file then it is assumed this is a 'free tier' license.
For some properties, such as the number of seats available to this developer ID, it is
necessary to check the details online via the HARMAN servers. For this, you would need to
first call checkDetailsOnline
, and wait for the complete
event
before then checking the values. Default zero/null values will be returned until the
relevant information has been successfully retrieved.
The goal is for an application running via ADL to be able to check the status of the local license, or for an installed application to be able to find out the relevant details. In order to prevent mis-use, if someone tried to take anyone else's developer ID and find out the details for this, this should not be possible due to the security checks that are implemented within this functionality.
Property | Defined by | ||
---|---|---|---|
constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | ||
creationDate : Date
[read-only]
Date of creation of the license file (as embedded in the adt.lic file)
| License | ||
developerID : String
[read-only]
Developer ID for this license
| License | ||
expiryDate : Date
[read-only]
Expiry date of a license that was loaded from a file.
| License | ||
isValid : Boolean
[read-only]
Validity of the license.
| License | ||
level : String
[read-only]
Level of the license (enterprise/professional/basic/free)
| License | ||
numberOfSeats : uint
[read-only]
Number of developer seats for this licensee (only available after the
details have been checked online).
| License | ||
prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object |
Method | Defined by | ||
---|---|---|---|
License()
Default constructor - do not call this directly, instead use one of the static methods
such as
load or loadFromFile . | License | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event.
| EventDispatcher | ||
Checks the license details online against the HARMAN licensing server.
| License | ||
Dispatches an event into the event flow.
| EventDispatcher | ||
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event.
| EventDispatcher | ||
Indicates whether an object has a specified property defined.
| Object | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter.
| Object | ||
[static]
Load data from the default location for this application or user.
| License | ||
[static]
Load data from a specific adt.lic file rather than pick up the application license.
| License | ||
Indicates whether the specified property exists and is enumerable.
| Object | ||
Removes a listener from the EventDispatcher object.
| EventDispatcher | ||
Sets the availability of a dynamic property for loop operations.
| Object | ||
Returns the string representation of this object, formatted according to locale-specific conventions.
| Object | ||
Returns the string representation of the specified object.
| Object | ||
Returns the primitive value of the specified object.
| Object | ||
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type.
| EventDispatcher |
Event | Summary | Defined by | ||
---|---|---|---|---|
[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher | |||
Dispatched when the online license check has completed successfully. | License | |||
[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher | |||
Dispatched when an input/output error occurs that causes the
License.checkDetailsOneline() operation to fail. | License | |||
Dispatched if a call to License.checkDetailsOnline()
attempts to load data from a server outside the security sandbox. | License |
Constant | Defined by | ||
---|---|---|---|
BASIC : String = "basic" [static]
Definition for a Basic license level
| License | ||
ENTERPRISE : String = "enterprise" [static]
Definition for an Enterprise license level
| License | ||
FREE : String = "free" [static]
Definition for a Free Tier license level
| License | ||
PROFESSIONAL : String = "professional" [static]
Definition for a Professional license level
| License |
creationDate | property |
creationDate:Date
[read-only]Date of creation of the license file (as embedded in the adt.lic file)
Implementation public function get creationDate():Date
developerID | property |
developerID:String
[read-only]Developer ID for this license
Implementation public function get developerID():String
expiryDate | property |
expiryDate:Date
[read-only]Expiry date of a license that was loaded from a file.
Once the license has been checked online, this would give the developer's license expiry.
Implementation public function get expiryDate():Date
isValid | property |
isValid:Boolean
[read-only]Validity of the license. If the license is not valid, there is no developer ID, and the license level is assumed to be 'free'.
Implementation public function get isValid():Boolean
level | property |
level:String
[read-only]Level of the license (enterprise/professional/basic/free)
Implementation public function get level():String
numberOfSeats | property |
numberOfSeats:uint
[read-only]Number of developer seats for this licensee (only available after the details have been checked online).
Implementation public function get numberOfSeats():uint
License | () | constructor |
public function License()
Language version: | ActionScript 3.0 |
Runtime version: | AIR 51 |
Default constructor - do not call this directly, instead use one of the static methods
such as load
or loadFromFile
.
checkDetailsOnline | () | method |
public function checkDetailsOnline():Boolean
Language version: | ActionScript 3.0 |
Runtime version: | AIR 51 |
Checks the license details online against the HARMAN licensing server.
When the license check is successfully completed, a complete
event
will be dispatched. Errors will be indicated by ioError
or securityError
.
Note that there must be a valid license file in place before this function can be called: if this
is called when there is no valid developerID
property, the function will return false
.
Boolean |
load | () | method |
public static function load():License
Load data from the default location for this application or user.
If the app is running via ADL, this looks for the user's developer license file (adt.lic), normally in the user's home folder. If the app is a deployed application then the license will be read from the generated license.txt file that should be within the installation folder.
ReturnsLicense |
loadFromFile | () | method |
public static function loadFromFile(license:File):License
Load data from a specific adt.lic file rather than pick up the application license.
Parameterslicense:File |
License |
complete | event |
flash.events.Event
flash.events.Event.COMPLETE
Language version: | ActionScript 3.0 |
Runtime version: | AIR 51 |
Dispatched when the online license check has completed successfully.
The Event.COMPLETE
constant defines the value of the type
property of a complete
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The network object that has completed loading. |
ioError | event |
flash.events.IOErrorEvent
flash.events.IOErrorEvent.IO_ERROR
Language version: | ActionScript 3.0 |
Runtime version: | AIR 51 |
Dispatched when an input/output error occurs that causes the
License.checkDetailsOneline()
operation to fail.
Defines the value of the type
property of an ioError
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
errorID | A reference number associated with the specific error (AIR only). |
target | The network object experiencing the input/output error. |
text | Text to be displayed as an error message. |
securityError | event |
flash.events.SecurityErrorEvent
flash.events.SecurityErrorEvent.SECURITY_ERROR
Language version: | ActionScript 3.0 |
Runtime version: | AIR 51 |
Dispatched if a call to License.checkDetailsOnline()
attempts to load data from a server outside the security sandbox.
The SecurityErrorEvent.SECURITY_ERROR
constant defines the value of the type
property of a securityError
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The network object reporting the security error. |
text | Text to be displayed as an error message. |
BASIC | constant |
public static const BASIC:String = "basic"
Definition for a Basic license level
ENTERPRISE | constant |
public static const ENTERPRISE:String = "enterprise"
Definition for an Enterprise license level
FREE | constant |
public static const FREE:String = "free"
Definition for a Free Tier license level
PROFESSIONAL | constant |
public static const PROFESSIONAL:String = "professional"
Definition for a Professional license level