ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
com.adobe.dct.util 

HTTPUtil  - AS3 Data Dictionary

Packagecom.adobe.dct.util
Classpublic class HTTPUtil
InheritanceHTTPUtil Inheritance Object

Language Version: ActionScript 3.0
Product Version: Data Dictionary Building Block 9.5
Runtime Versions: AIR (unsupported), Flash Player 10.2

A utility class that is used to obtain an HTTP URL or request related information.



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
Public Methods
 MethodDefined By
  
Constructor.
HTTPUtil
  
[static] Retrieves the context that follows the base of the URL. For example, http://www.adobe.com/snc?x=1&y=2 returns /snc.
HTTPUtil
  
[static] Retrieves the current host name. For example, http://www.adobe.com/?x=1&y=2 returns www.adobe.com.
HTTPUtil
  
[static] Retrieves a URL parameter value by name and returns it as a string.
HTTPUtil
  
[static] Retrieves the current port for the URL.
HTTPUtil
  
[static] Retrieves the current protocol, such as http: or https:.
HTTPUtil
  
[static] Retrieves the current URL of the application used to play the SWF file.
HTTPUtil
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Constructor Detail

HTTPUtil

()Constructor
public function HTTPUtil()

Language Version: ActionScript 3.0
Product Version: Data Dictionary Building Block 9.5
Runtime Versions: AIR (unsupported), Flash Player 10.2

Constructor.

Method Detail

getContext

()method
public static function getContext():String

Language Version: ActionScript 3.0
Product Version: Data Dictionary Building Block 9.5
Runtime Versions: AIR (unsupported), Flash Player 10.2

Retrieves the context that follows the base of the URL.

For example, http://www.adobe.com/snc?x=1&y=2 returns /snc.

Returns
String — The context that follows the base of the URL.

getHostName

()method 
public static function getHostName():String

Language Version: ActionScript 3.0
Product Version: Data Dictionary Building Block 9.5
Runtime Versions: AIR (unsupported), Flash Player 10.2

Retrieves the current host name.

For example, http://www.adobe.com/?x=1&y=2 returns www.adobe.com.

Returns
String — The current host name.

getParameterValue

()method 
public static function getParameterValue(key:String):String

Language Version: ActionScript 3.0
Product Version: Data Dictionary Building Block 9.5
Runtime Versions: AIR (unsupported), Flash Player 10.2

Retrieves a URL parameter value by name and returns it as a string. This function works without passing a FlashVars property into the SWF.

For example, even if the URL is domain.com?MyFlexPage.html?b=5, it still returns 5 when 'b' is passed.

This function uses JavaScript to find the URL parameters. Please note, however, that it only works for a GET request. It does not work for a POST request.

Parameters

key:String — the url parameter key

Returns
String — The URL parameter value by name, as a string.

getPort

()method 
public static function getPort():String

Language Version: ActionScript 3.0
Product Version: Data Dictionary Building Block 9.5
Runtime Versions: AIR (unsupported), Flash Player 10.2

Retrieves the current port for the URL.

Returns
String — The current port for the URL.

getProtocol

()method 
public static function getProtocol():String

Language Version: ActionScript 3.0
Product Version: Data Dictionary Building Block 9.5
Runtime Versions: AIR (unsupported), Flash Player 10.2

Retrieves the current protocol, such as http: or https:.

Returns
String — The current protocol, such as http: or https:.

getUrl

()method 
public static function getUrl():String

Language Version: ActionScript 3.0
Product Version: Data Dictionary Building Block 9.5
Runtime Versions: AIR (unsupported), Flash Player 10.2

Retrieves the current URL of the application used to play the SWF file. For example, Adobe Flash Player.

Returns
String — The current URL of the SWF player.