<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; UIDUtil</title>
	<atom:link href="http://blog.flexexamples.com/category/uidutil/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating unique identifiers for objects using the getUID() method</title>
		<link>http://blog.flexexamples.com/2007/11/01/creating-unique-identifiers-for-objects-using-the-getuid-method/</link>
		<comments>http://blog.flexexamples.com/2007/11/01/creating-unique-identifiers-for-objects-using-the-getuid-method/#comments</comments>
		<pubDate>Fri, 02 Nov 2007 02:45:14 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ObjectUtil]]></category>
		<category><![CDATA[UIDUtil]]></category>
		<category><![CDATA[getUID()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/11/01/creating-unique-identifiers-for-objects-using-the-getuid-method/</guid>
		<description><![CDATA[<p>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 [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use the static <code>UIDUtil.getUID()</code> 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 <code>ObjectUtil.toString()</code>!). The second time you click the Display UID button, you&#8217;ll notice that a new parameter is added to the Object, mx_internal_uid.</p>
<p>Full code after the jump.</p>
<p><span id="more-266"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/UIDUtil_getUID_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/11/01/creating-unique-identifiers-for-objects-using-the-getuid-method/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.Alert;
            import mx.utils.ObjectUtil;
            import mx.utils.UIDUtil;

            private function displayUID():void {
                var text:String = ObjectUtil.toString(myObj);
                var title:String = UIDUtil.getUID(myObj);
                Alert.show(text, title);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Object id="myObj" name="peter" site="flexexamples.com" /&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button label="Display UID"
                click="displayUID();" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/UIDUtil_getUID_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/UIDUtil_getUID_test/bin/main.html" width="100%" height="200"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating unique identifiers for objects using the getUID() method on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/11/01/creating-unique-identifiers-for-objects-using-the-getuid-method/',contentID: 'post-266',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'getUID()',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/11/01/creating-unique-identifiers-for-objects-using-the-getuid-method/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Creating unique identifiers with Flex</title>
		<link>http://blog.flexexamples.com/2007/11/01/creating-unique-identifiers-with-flex/</link>
		<comments>http://blog.flexexamples.com/2007/11/01/creating-unique-identifiers-with-flex/#comments</comments>
		<pubDate>Fri, 02 Nov 2007 02:29:25 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[UIDUtil]]></category>
		<category><![CDATA[createUID()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/11/01/creating-unique-identifiers-with-flex/</guid>
		<description><![CDATA[<p>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: &#8220;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&#8221;.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/UIDUtil_createUID_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- [...]]]></description>
			<content:encoded><![CDATA[<p>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 <code>UIDUtil.createUID()</code> method, you can easily create a hexadecimal string in the following format: &#8220;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&#8221;.</p>
<p>Full code after the jump.</p>
<p><span id="more-265"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/UIDUtil_createUID_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/11/01/creating-unique-identifiers-with-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="generateUID();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.utils.UIDUtil;

            private function generateUID():void {
                lbl.text = UIDUtil.createUID();
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button id="btn"
                label="Create UID"
                click="generateUID();" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Label id="lbl"
            fontSize="20"
            selectable="true" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/UIDUtil_createUID_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/UIDUtil_createUID_test/bin/main.html" width="100%" height="200"></iframe></p>
<p class="note">Note that the generated unique identifier is not a globally unique value, but rather a pseudo-random number generator based on the current time.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating unique identifiers with Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/11/01/creating-unique-identifiers-with-flex/',contentID: 'post-265',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'createUID()',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/11/01/creating-unique-identifiers-with-flex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

