mx.utils

# RPCUIDUtil - AS3 Flex

Package | mx.utils
Class | public class RPCUIDUtil
Inheritance | RPCUIDUtil Object

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The RPCUIDUtil class is a copy of UIDUtil without some functions that cause dependency problems when RPC messages are put in a bootstrap loader.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | createUID():String [static] Generates a UID (unique identifier) based on ActionScript's pseudo-random number generator and the current time. | RPCUIDUtil
|  | fromByteArray(ba:ByteArray):String [static] Converts a 128-bit UID encoded as a ByteArray to a String representation. | RPCUIDUtil
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | isUID(uid:String):Boolean [static] A utility method to check whether a String value represents a correctly formatted UID value. | RPCUIDUtil
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toByteArray(uid:String):ByteArray [static] Converts a UID formatted String to a ByteArray. | RPCUIDUtil
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Method Detail

### createUID

()
method

`public static function createUID():String`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Generates a UID (unique identifier) based on ActionScript's pseudo-random number generator and the current time.

The UID has the form `"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"` where X is a hexadecimal digit (0-9, A-F).

This UID will not be truly globally unique; but it is the best we can do without player support for UID generation.

Returns

| `String` — The newly-generated UID.

### fromByteArray

()
method

`public static function fromByteArray(ba:ByteArray):String`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Converts a 128-bit UID encoded as a ByteArray to a String representation. The format matches that generated by createUID. If a suitable ByteArray is not provided, null is returned.

Parameters

| `ba:ByteArray` — ByteArray 16 bytes in length representing a 128-bit UID.

Returns

| `String` — String representation of the UID, or null if an invalid ByteArray is provided.

### isUID

()
method

`public static function isUID(uid:String):Boolean`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

A utility method to check whether a String value represents a correctly formatted UID value. UID values are expected to be in the format generated by createUID(), implying that only capitalized A-F characters in addition to 0-9 digits are supported.

Parameters

| `uid:String` — The value to test whether it is formatted as a UID.

Returns

| `Boolean` — Returns true if the value is formatted as a UID.

### toByteArray

()
method

`public static function toByteArray(uid:String):ByteArray`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Converts a UID formatted String to a ByteArray. The UID must be in the format generated by createUID, otherwise null is returned.

Parameters

| `uid:String` — representing a 128-bit UID

Returns

| `ByteArray` — ByteArray 16 bytes in length representing the 128-bits of the UID or null if the uid could not be converted.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00