View comments | RSS feed
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
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 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.




Comments


Rambo 007 said on Dec 28, 2006 at 8:27 PM :
1) it would be WONDERFUL if the errant page in question were to be included in this bug report page (above, for context).

2) "assing" in getUID? "Assign" perhaps?

3) getUID mentions a map -- what map? "If a map is specified" -- how does one specify it?

4) if getUID on an UIComponent returns the "uid" property value, say so here (in the UIDUTtil documentation) please.
smgilson said on Jan 2, 2007 at 1:09 PM :
Thanks for the comments. I cannot believe that no one has yet to report #2.

For #3, that is comment about a map was for an argument that was removed from the getUID() method. That statement should have been removed with the argument.

For #4, we will make the update.

Stephen Gilson
Flex Doc Team

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flex/2/langref/mx/utils/UIDUtil.html