The following example shows how you can use the static UIDUtil.getUID() method to generate and retreive a unique identifier for an Object. The first time you click the Display UID button, an Alert control displays the generated UID and a string representation of the Object (yay ObjectUtil.toString()!). The second time you click the Display UID button, you’ll notice that a new parameter is added to the Object, mx_internal_uid.
Full code after the jump.
Continue reading ‘Creating unique identifiers for objects using the getUID() method’
The following example shows you how you can create a unique indentifier (UID) with Flex using the UIDUtil class in the mx.utils package. By calling the static UIDUtil.createUID() method, you can easily create a hexadecimal string in the following format: “XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX”.
Full code after the jump.
Continue reading ‘Creating unique identifiers with Flex’
The following example shows how you can resize a DataGrid control in Flex using the rowCount property. By setting the rowCount property, the DataGrid control is automatically resized so that only the specified number of rows are displayed.
In Flex 3 (post beta 2, you can grab nightly versions of the Flex 3 SDK from the Adobe Labs Flex 3 SDK page) the DataGrid control’s rowCount and lockedRowCount properties do not include the header whereas in earlier versions of Flex 3 and Flex 2 they did. For example, the old behavior was to display 3 rows and the data grid header if you set the row count to 4. The new behavior is to display 4 rows and the data grid header (for a total of 5 rows). Yay!
Full code after the jump.
Continue reading ‘Resizing a Flex DataGrid control using the rowCount property’