zoukankan      html  css  js  c++  java
  • Creating unique identifiers for objects using the getUID() (转载)

    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
    <?xml version="1.0" encoding="utf-8"?>
    <!-- http://blog.flexexamples.com/2007/11/01/creating-unique-identifiers-for-objects-using-the-getuid-method/ -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
            layout
    ="vertical"
            verticalAlign
    ="middle"
            backgroundColor
    ="white">

        
    <mx:Script>
            
    <![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);
                }
            
    ]]>
        
    </mx:Script>

        
    <mx:Object id="myObj" name="peter" site="flexexamples.com" />

        
    <mx:ApplicationControlBar dock="true">
            
    <mx:Button label="Display UID"
                    click
    ="displayUID();" />
        
    </mx:ApplicationControlBar>

    </mx:Application>
  • 相关阅读:
    真彩色、假彩色和伪彩色的区别
    octave——基本操作
    Octave快速入门级下载链接
    unix下的常用命令
    职业——步入工作前的一点感悟
    Python—实例中self含义
    面向对象编程
    mysql查看数据表索引信息
    解决yii框架,gii脚手架不能使用。
    php 多维数组简化(递归)
  • 原文地址:https://www.cnblogs.com/wuhenke/p/1642793.html
Copyright © 2011-2022 走看看