Access keys

LocationUtil

Kind of class: class
Inherits from: none
Version: 01/16/07
Author: Aaron Clinger
Classpath: org.casaframework.util.LocationUtil
File last modified: Wednesday, 24 January 2007, 21:45:40
Util functions for detecting SWF's file location.

Class methods

getDomain

static function getDomain (
location:MovieClip) : String
Detects MovieClip's domain location.
Parameters:
location:
MovieClip to get location of.
Returns:
Returns full domain (including sub-domains) of MovieClip's location.
Usage:
trace(LocationUtil.getDomain(_root));
Usage note:
Function does not return folder path or file name. The method also treats "www" and sans "www" as the same; if "www" is present method does not return it.

isDomain

static function isDomain (
location:MovieClip, domain:String) : Boolean
Detects if MovieClip's embed location matches passed domain.
Parameters:
location:
MovieClip to compare location of.
domain :
Web domain.
Returns:
Returns true if file's embed location matched passed domain; otherwise false.
Usage:
To check for domain:
trace(LocationUtil.isDomain(_root, "google.com"));
trace(LocationUtil.isDomain(_root, "bbc.co.uk"));

You can even check for subdomains:
trace(LocationUtil.isDomain(_root, "subdomain.aaronclinger.com"))

isIDE

static function isIDE (
) : Boolean

isPlugin

static function isPlugin (
) : Boolean

isStandalone

static function isStandalone (
) : Boolean

isWeb

static function isWeb (
location:MovieClip) : Boolean