• 【设为首页】
  • 【收藏闪客居】
当前位置:主页>FLASH AS 编程>AS基础篇>AS 3.0>文章内容
  • [AS3]TypeDescriptor-Flash类对象(或变量)的遍历器
  • 来源:Kinglong's blog 作者:Kinglong 2007-10-22 【

[AS3]TypeDescriptor-Flash类对象(或变量)的遍历器
【组件版本】:0.2
【功能简述】:对变量或类对象的遍历,提供类似于帮助文件那样的文本信息。
【运行平台】:Flash CS3,ActionScript3,Flash Player 9 +
【类路径】:com.klstudio.util.TypeDescriptor
【方法说明】:public static function describeTypeAll(target:*):String
【调用实例】:
  1. import com.klstudio.util.TypeDescriptor;   
  2. import flash.display.Sprite;   
  3. var sprite:Sprite = new Sprite();   
  4. trace(TypeDescriptor.describeTypeAll(sprite));    
  5. trace(TypeDescriptor.describeTypeAll(Sprite));   


【运行结果】:
两个方法运行 显示的结果都是如下内容;
  1. [Package] flash.display   
  2. [Class] Sprite   
  3. [Inheritance] flash.display.DisplayObjectContainer -> flash.display.InteractiveObject -> flash.display.DisplayObject -> flash.events.EventDispatcher -> Object   
  4. [Implements] flash.events.IEventDispatcher,flash.display.IBitmapDrawable   
  5. [Properties]    
  6.     buttonMode:Boolean [readwrite]   
  7.     graphics:flash.display.Graphics [readonly]   
  8.     useHandCursor:Boolean [readwrite]   
  9.     soundTransform:flash.media.SoundTransform [readwrite]   
  10.     dropTarget:flash.display.DisplayObject [readonly]   
  11.     hitArea:flash.display.Sprite [readwrite]   
  12.     textSnapshot:flash.text.TextSnapshot [readonly]   
  13.     mouseChildren:Boolean [readwrite]   
  14.     numChildren:int [readonly]   
  15.     tabChildren:Boolean [readwrite]   
  16.     tabEnabled:Boolean [readwrite]   
  17.     doubleClickEnabled:Boolean [readwrite]   
  18.     contextMenu:flash.ui.ContextMenu [readwrite]   
  19.     accessibilityImplementation:flash.accessibility.AccessibilityImplementation [readwrite]   
  20.     mouseEnabled:Boolean [readwrite]   
  21.     focusRect:Object [readwrite]   
  22.     tabIndex:int [readwrite]   
  23.     x:Number [readwrite]   
  24.     y:Number [readwrite]   
  25.     blendMode:String [readwrite]   
  26.     scale9Grid:flash.geom.Rectangle [readwrite]   
  27.     alpha:Number [readwrite]   
  28.     name:String [readwrite]   
  29.     rotation:Number [readwrite]   
  30.     scrollRect:flash.geom.Rectangle [readwrite]   
  31.     cacheAsBitmap:Boolean [readwrite]   
  32.     accessibilityProperties:flash.accessibility.AccessibilityProperties [readwrite]   
  33.     scaleX:Number [readwrite]   
  34.     visible:Boolean [readwrite]   
  35.     width:Number [readwrite]   
  36.     opaqueBackground:Object [readwrite]   
  37.     height:Number [readwrite]   
  38.     scaleY:Number [readwrite]   
  39.     mouseX:Number [readonly]   
  40.     mask:flash.display.DisplayObject [readwrite]   
  41.     parent:flash.display.DisplayObjectContainer [readonly]   
  42.     mouseY:Number [readonly]   
  43.     loaderInfo:flash.display.LoaderInfo [readonly]   
  44.     transform:flash.geom.Transform [readwrite]   
  45.     root:flash.display.DisplayObject [readonly]   
  46.     stage:flash.display.Stage [readonly]   
  47.     filters:Array [readwrite]   
  48. [Methods]    
  49.     startDrag(param0:Boolean[optional],param1:flash.geom.Rectangle[optional]):void  
  50.     stopDrag():void  
  51.     addChild(param0:flash.display.DisplayObject):flash.display.DisplayObject   
  52.     swapChildren(param0:flash.display.DisplayObject,param1:flash.display.DisplayObject):void  
  53.     getChildByName(param0:String):flash.display.DisplayObject   
  54.     getObjectsUnderPoint(param0:flash.geom.Point):Array   
  55.     removeChildAt(param0:int):flash.display.DisplayObject   
  56.     getChildIndex(param0:flash.display.DisplayObject):int  
  57.     areInaccessibleObjectsUnderPoint(param0:flash.geom.Point):Boolean   
  58.     removeChild(param0:flash.display.DisplayObject):flash.display.DisplayObject   
  59.     setChildIndex(param0:flash.display.DisplayObject,param1:int):void  
  60.     addChildAt(param0:flash.display.DisplayObject,param1:int):flash.display.DisplayObject   
  61.     swapChildrenAt(param0:int,param1:int):void  
  62.     contains(param0:flash.display.DisplayObject):Boolean   
  63.     getChildAt(param0:int):flash.display.DisplayObject   
  64.     globalToLocal(param0:flash.geom.Point):flash.geom.Point   
  65.     getBounds(param0:flash.display.DisplayObject):flash.geom.Rectangle   
  66.     hitTestPoint(param0:Number,param1:Number,param2:Boolean[optional]):Boolean   
  67.     getRect(param0:flash.display.DisplayObject):flash.geom.Rectangle   
  68.     hitTestObject(param0:flash.display.DisplayObject):Boolean   
  69.     localToGlobal(param0:flash.geom.Point):flash.geom.Point   
  70.     hasEventListener(param0:String):Boolean   
  71.     toString():String   
  72.     willTrigger(param0:String):Boolean   
  73.     removeEventListener(param0:String,param1:Function,param2:Boolean[optional]):void  
  74.     addEventListener(param0:String,param1:Function,param2:Boolean[optional],param3:int[optional],param4:Boolean[optional]):void  
  75.     dispatchEvent(param0:flash.events.Event):Boolean  

【组件下载】:http://www.klstudio.com/demo/mxp/TypeDescriptor.mxp



上一篇:AS3 学习源码-打汽球   下一篇:Flash As3 : 定时运行
  • 用户名:新注册) 密码: 匿名评论
  • 评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规)

Copyright © 2006-2008 flashas.net All Rights Reserved.
网站内容咨询: admin#flashas.net (#为@) 联系QQ:40777822 浙ICP备06033001号
(本网站最佳浏览解析度为1024*768, 建议使用IE 6.0或以上版本浏览器。)