Adobe Flex 2 Language Reference - collected by Jimbob | Back to MY RESOURCES


Packagemx.utils
Classpublic class UIDUtil
InheritanceUIDUtil Inheritance Object

The UIDUtil class is an all-static class with methods for working with UIDs (unique identifiers) within Flex. You do not create instances of UIDUtil; instead you simply call static methods such as the UIDUtil.createUID() method.

Note: I you have a dynamic object that has no [Bindable] properties (which force the object to implement the IUID interface), Flex adds an mx_internal_uid property that contains a UID to the object. To avoid having this field in your dynamic object, make it [Bindable], implement the IUID interface in the object class, or set a uid property with a value.



Public Properties
 PropertyDefined by
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined by
  
[static] Generates a UID (unique identifier) based on ActionScript's pseudo-random number generator and the current time.
UIDUtil
  
[static] Returns the UID (unique identifier) for the specified object.
UIDUtil
 Inherited
setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Method detail
createUID()method
public static function createUID():String

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.
getUID()method 
public static function getUID(item:Object):String

Returns the UID (unique identifier) for the specified object. If the specified object doesn't have an UID then the method assings one to it. If a map is specified this method will use the map to construct the UID. As a special case, if the item passed in is null, this method returns a null UID.

Parameters
item:Object — Object that we need to find the UID for.

Returns
String — The UID that was either found or generated.





collected by Jimbob 2007.05