mx.utils.UIDUtil类的createUID()与getUID()

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
 <fx:Declarations>
  <!-- 将非可视元素(例如服务、值对象)放在此处 -->
 </fx:Declarations>
 <fx:Script>
  <![CDATA[
   import mx.utils.UIDUtil;
   
   private function createUID():void {
    lbl.text = UIDUtil.createUID();
   }
   
   private function getUID():void {
    lbl2.text = UIDUtil.getUID(lbl.text);
   }
  ]]>
 </fx:Script>
 <s:Button id="btn" label="Create UID" click="createUID();" />
 <s:Label id="lbl" y="50" />
 <s:Button id="btn2" label="Get UID" click="getUID();" y="100" />
 <s:Label id="lbl2" y="150" />
</s:Application>

参考:

http://blog.minidx.com/2008/11/04/1603.html

http://blog.minidx.com/2008/11/05/1604.html

你可能感兴趣的:(createUID,getUID)