Packagemx.utils
Classpublic class NameUtil
InheritanceNameUtil Inheritance Object

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

The NameUtil utility class defines static methods for creating names for Flex objects. You do not create instances of NameUtil; instead you call static methods of the class, such as the NameUtil.createName() method.



Public Methods
 MethodDefined By
  
createUniqueName(object:Object):String
[static] Creates a unique name for any Object instance, such as "Button12", by combining the unqualified class name with an incrementing counter.
NameUtil
  
displayObjectToString(displayObject:DisplayObject):String
[static] Returns a string, such as "MyApplication0.addressForm.lastName.TextField17", for a DisplayObject object that indicates its position in the hierarchy of DisplayObject objects in an application.
NameUtil
  
getUnqualifiedClassName(object:Object):String
[static] Returns the name of the specified object's class, such as "Button" This string does not include the package name.
NameUtil
Method Detail
createUniqueName()method
public static function createUniqueName(object:Object):String

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

Creates a unique name for any Object instance, such as "Button12", by combining the unqualified class name with an incrementing counter.

Parameters

object:Object — Object requiring a name.

Returns
String — String containing the unique name.
displayObjectToString()method 
public static function displayObjectToString(displayObject:DisplayObject):String

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

Returns a string, such as "MyApplication0.addressForm.lastName.TextField17", for a DisplayObject object that indicates its position in the hierarchy of DisplayObject objects in an application.

Parameters

displayObject:DisplayObject — A DisplayObject object whose hierarchy in the application is desired.

Returns
String — String containing the position of displayObject in the hierarchy of DisplayObject objects in an application.
getUnqualifiedClassName()method 
public static function getUnqualifiedClassName(object:Object):String

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

Returns the name of the specified object's class, such as "Button"

This string does not include the package name. If you need the package name as well, call the getQualifiedClassName() method in the flash.utils package. It will return a string such as "mx.controls::Button".

Parameters

object:Object — The object.

Returns
String — The name of the specified object's class.