Packagecom.google.analytics.utils
Classpublic class Environment

Environment provides informations for the local environment.



Public Properties
 PropertyDefined by
  appName : String
Indicates the name of the application.
Environment
  appVersion : Version
Indicates the version of the application.
Environment
  documentTitle : String
[read-only] Indicates the title of the document.
Environment
  domainName : String
[read-only] Indicates the local domain name value.
Environment
  flashVersion : Version
[read-only] Returns the flash version object representation of the application.
Environment
  language : String
[read-only] Returns the language string as a lowercase two-letter language code from ISO 639-1.
Environment
  languageEncoding : String
[read-only] Returns the internal character set used by the flash player

Logic : by default flash player use unicode internally so we return UTF-8.

If the player use the system code page then we try to return the char set of the browser.

Environment
  locationPath : String
[read-only] Indicates the locationPath value.
Environment
  locationSearch : String
[read-only] Indicates the locationSearch value.
Environment
  locationSWFPath : String
[read-only] Indicates the location of swf.
Environment
  operatingSystem : String
[read-only] Returns the operating system string.
Environment
  platform : String
[read-only] Returns the platform, can be "Windows", "Macintosh" or "Linux"
Environment
  playerType : String
[read-only] Returns the player type.
Environment
  protocol : Protocols
[read-only] Indicates the Protocols object of this local info.
Environment
  referrer : String
[read-only] Indicates the referrer value.
Environment
  screenColorDepth : String
[read-only] In AIR we can use flash.display.Screen to directly get the colorDepth property in flash player we can only access screenColor in flash.system.Capabilities.
Environment
  screenHeight : Number
[read-only] Indicates the height of the screen.
Environment
  screenWidth : Number
[read-only] Indicates the width of the screen.
Environment
  userAgent : UserAgent
Defines a custom user agent.
Environment
Public Methods
 MethodDefined by
  
Environment(url:String = "", app:String = "", version:String = "", debug:DebugConfiguration = null, dom:HTMLDOM = null)
Creates a new Environment instance.
Environment
  
isAIR():Boolean
Indicates if the application is running in AIR.
Environment
  
isInHTML():Boolean
Indicates if the SWF is embeded in an HTML page.
Environment
Property detail
appNameproperty
appName:String  [read-write]

Indicates the name of the application.

Implementation
    public function get appName():String
    public function set appName(value:String):void
appVersionproperty 
appVersion:Version  [read-write]

Indicates the version of the application.

Implementation
    public function get appVersion():Version
    public function set appVersion(value:Version):void
documentTitleproperty 
documentTitle:String  [read-only]

Indicates the title of the document.

Implementation
    public function get documentTitle():String
domainNameproperty 
domainName:String  [read-only]

Indicates the local domain name value.

Implementation
    public function get domainName():String
flashVersionproperty 
flashVersion:Version  [read-only]

Returns the flash version object representation of the application.

This object contains the attributes major, minor, build and revision :

Example :

         import com.google.analytics.utils.Environment ;
         
         var info:Environment = new Environment( "http://www.domain.com" ) ;
         var version:Object = info.flashVersion ;
         
         trace( version.major    ) ; // 9
         trace( version.minor    ) ; // 0
         trace( version.build    ) ; // 124
         trace( version.revision ) ; // 0
         
Implementation
    public function get flashVersion():Version
languageproperty 
language:String  [read-only]

Returns the language string as a lowercase two-letter language code from ISO 639-1.

Implementation
    public function get language():String

See also

Capabilities.language
languageEncodingproperty 
languageEncoding:String  [read-only]

Returns the internal character set used by the flash player

Logic : by default flash player use unicode internally so we return UTF-8.

If the player use the system code page then we try to return the char set of the browser.

Implementation
    public function get languageEncoding():String
locationPathproperty 
locationPath:String  [read-only]

Indicates the locationPath value.

Implementation
    public function get locationPath():String
locationSearchproperty 
locationSearch:String  [read-only]

Indicates the locationSearch value.

Implementation
    public function get locationSearch():String
locationSWFPathproperty 
locationSWFPath:String  [read-only]

Indicates the location of swf.

Implementation
    public function get locationSWFPath():String
operatingSystemproperty 
operatingSystem:String  [read-only]

Returns the operating system string.

Note: The flash documentation indicate those strings

  • "Windows XP"
  • "Windows 2000"
  • "Windows NT"
  • "Windows 98/ME"
  • "Windows 95"
  • "Windows CE" (available only in Flash Player SDK, not in the desktop version)
  • "Linux"
  • "MacOS"
  • Other strings we can obtain ( not documented : "Mac OS 10.5.4" , "Windows Vista")

    Implementation
        public function get operatingSystem():String

    See also

    Capabilities.os
    platformproperty 
    platform:String  [read-only]

    Returns the platform, can be "Windows", "Macintosh" or "Linux"

    Implementation
        public function get platform():String

    See also

    Capabilities.manufacturer
    playerTypeproperty 
    playerType:String  [read-only]

    Returns the player type.

    Note : The flash documentation indicate those strings.

  • "ActiveX" : for the Flash Player ActiveX control used by Microsoft Internet Explorer.
  • "Desktop" : for the Adobe AIR runtime (except for SWF content loaded by an HTML page, which has Capabilities.playerType set to "PlugIn").
  • "External" : for the external Flash Player "PlugIn" for the Flash Player browser plug-in (and for SWF content loaded by an HTML page in an AIR application).
  • "StandAlone" : for the stand-alone Flash Player.
  • Implementation
        public function get playerType():String

    See also

    Capabilities.playerType
    protocolproperty 
    protocol:Protocols  [read-only]

    Indicates the Protocols object of this local info.

    Implementation
        public function get protocol():Protocols
    referrerproperty 
    referrer:String  [read-only]

    Indicates the referrer value.

    Implementation
        public function get referrer():String
    screenColorDepthproperty 
    screenColorDepth:String  [read-only]

    In AIR we can use flash.display.Screen to directly get the colorDepth property in flash player we can only access screenColor in flash.system.Capabilities.

    Some ref : http://en.wikipedia.org/wiki/Color_depth

  • "color" -> 16-bit or 24-bit or 32-bit
  • "gray" -> 2-bit
  • "bw" -> 1-bit
  • Implementation
        public function get screenColorDepth():String
    screenHeightproperty 
    screenHeight:Number  [read-only]

    Indicates the height of the screen.

    Implementation
        public function get screenHeight():Number

    See also

    Capabilities.screenResolutionY
    screenWidthproperty 
    screenWidth:Number  [read-only]

    Indicates the width of the screen.

    Implementation
        public function get screenWidth():Number

    See also

    Capabilities.screenResolutionX
    urlproperty 
    url:String  [write-only]

    Sets the stage reference value of the application.

    Implementation
        ga_internal function set url(value:String):void
    userAgentproperty 
    userAgent:UserAgent  [read-write]

    Defines a custom user agent.

    For case where the user would want to define its own application name and version it is possible to change appName and appVersion which are in sync with applicationProduct and applicationVersion properties.

    Implementation
        public function get userAgent():UserAgent
        public function set userAgent(value:UserAgent):void
    Constructor detail
    Environment()constructor
    public function Environment(url:String = "", app:String = "", version:String = "", debug:DebugConfiguration = null, dom:HTMLDOM = null)

    Creates a new Environment instance.

    Parameters
    url:String (default = "") — The URL of the SWF.
     
    app:String (default = "") — The application name
     
    version:String (default = "") — The application version
     
    debug:DebugConfiguration (default = null) — the HTMLDOM reference.
     
    dom:HTMLDOM (default = null)
    Method detail
    isAIR()method
    public function isAIR():Boolean

    Indicates if the application is running in AIR.

    Returns
    Boolean
    isInHTML()method 
    public function isInHTML():Boolean

    Indicates if the SWF is embeded in an HTML page.

    Returns
    Booleantrue if the SWF is embeded in an HTML page.