| Package | cx.asQuery.starling |
| Class | public final class ASQueryObject |
| Inheritance | ASQueryObject Object |
| Method | Defined By | ||
|---|---|---|---|
ASQueryObject(root:DisplayObjectContainer, selector:*, onlyChild:Boolean = false) | ASQueryObject | ||
all(fun:Function):ASQueryObject
对所有元素执行操作
| ASQueryObject | ||
append(child:*):ASQueryObject
添加子元素
| ASQueryObject | ||
appendTo(parent:*):ASQueryObject
添加到父元素
| ASQueryObject | ||
attr(name:*, value:* = null):ASQueryObject
设置属性
| ASQueryObject | ||
bind(type:String, handler:Function):ASQueryObject
绑定事件监听
| ASQueryObject | ||
click(handler:Function):ASQueryObject
点击事件 (兼容按钮和普通显示对象)
| ASQueryObject | ||
dispose():void
清理所有资源,并释放
注意:贴图和bitmapData不会自动释放,如果释放操作写在显示对象的dispose方法里面则会调用
此方法无返回
| ASQueryObject | ||
移除所有子对象 ,但不释放他们的资源占用
| ASQueryObject | ||
find(selector:*, onlyChild:Boolean = false):ASQueryObject
通过新的选择器查找内部元素
| ASQueryObject | ||
fun(name:String, params:Array = null):ASQueryObject
调用函数
| ASQueryObject | ||
get(index:int = 0):DisplayObject
获取内部元素
| ASQueryObject | ||
getAttr(name:String):*
获取属性
| ASQueryObject | ||
getContainer(index:int = 0):DisplayObjectContainer
获取内部容器
| ASQueryObject | ||
length():int
获得内部元素个数
如果为0,表示没有获取到元素
| ASQueryObject | ||
ready(fun:Function):void
初始化方法
确保在舞台上或添加到舞台时触发一次
一般在显示对象构造函数中调用:$(this).ready(init)
| ASQueryObject | ||
移除自己
| ASQueryObject | ||
设置深度到底层
| ASQueryObject | ||
设置深度到顶层
| ASQueryObject | ||
toggle(name:String = null):ASQueryObject
切换Boolean类型的属性状态
| ASQueryObject | ||
toString():String
输出字符串
| ASQueryObject | ||
touch(handler:Function):ASQueryObject
绑定touch事件
| ASQueryObject | ||
touchBegin(handler:Function):ASQueryObject
绑定Touch Begin事件
| ASQueryObject | ||
touchEnd(handler:Function):ASQueryObject
绑定Touch End事件
| ASQueryObject | ||
touchHover(handler:Function):ASQueryObject
绑定Touch Hover事件
| ASQueryObject | ||
touchMove(handler:Function):ASQueryObject
绑定Touch Move事件
| ASQueryObject | ||
trigger(event:Event):ASQueryObject
触发事件
| ASQueryObject | ||
unbind(type:String = null, handler:Function = null):ASQueryObject
解除事件监听
释放时可以不用显示调用此语句,因为Starling的dispose方法会清除所有子对象的监听。
| ASQueryObject | ||
| ASQueryObject | () | Constructor |
public function ASQueryObject(root:DisplayObjectContainer, selector:*, onlyChild:Boolean = false)Parameters
root:DisplayObjectContainer — 主容器
| |
selector:* — 选择器
| |
onlyChild:Boolean (default = false) — 是否只遍历主容器的第一层子对象(否则遍历所有层级的子集)
|
| all | () | method |
public function all(fun:Function):ASQueryObject对所有元素执行操作
Parameters
fun:Function |
ASQueryObject —
|
| append | () | method |
| appendTo | () | method |
| attr | () | method |
public function attr(name:*, value:* = null):ASQueryObject设置属性
Parameters
name:* — 属性名,如果有多个用{"x":10,"y":20}
| |
value:* (default = null) — 单属性要设置的值(支持"+=10","-=10","10","/=10"几个运算符操作)
|
ASQueryObject —
|
| bind | () | method |
public function bind(type:String, handler:Function):ASQueryObject绑定事件监听
Parameters
type:String — 事件类型
| |
handler:Function — 监听函数
|
ASQueryObject —
|
| click | () | method |
public function click(handler:Function):ASQueryObject点击事件 (兼容按钮和普通显示对象)
Parameters
handler:Function |
ASQueryObject —
|
| dispose | () | method |
public function dispose():void清理所有资源,并释放 注意:贴图和bitmapData不会自动释放,如果释放操作写在显示对象的dispose方法里面则会调用 此方法无返回
| empty | () | method |
| find | () | method |
public function find(selector:*, onlyChild:Boolean = false):ASQueryObject通过新的选择器查找内部元素
Parameters
selector:* — 选择器
| |
onlyChild:Boolean (default = false) — 是否只遍历第一层子对象(否则遍历所有层级的子集)
|
ASQueryObject —
|
| fun | () | method |
public function fun(name:String, params:Array = null):ASQueryObject调用函数
Parameters
name:String — 函数名
| |
params:Array (default = null) — 参数数组
|
ASQueryObject —
|
| get | () | method |
public function get(index:int = 0):DisplayObject获取内部元素
Parameters
index:int (default = 0) — 匹配的第几个
|
DisplayObject —
|
| getAttr | () | method |
public function getAttr(name:String):*获取属性
Parameters
name:String |
* —
|
| getContainer | () | method |
public function getContainer(index:int = 0):DisplayObjectContainer获取内部容器
Parameters
index:int (default = 0) — 匹配的第几个
|
DisplayObjectContainer —
|
| length | () | method |
public function length():int获得内部元素个数 如果为0,表示没有获取到元素
Returnsint —
|
| ready | () | method |
public function ready(fun:Function):void初始化方法 确保在舞台上或添加到舞台时触发一次 一般在显示对象构造函数中调用:$(this).ready(init)
Parameters
fun:Function — 初始化回调函数
此方法无返回
|
| remove | () | method |
| setIndexBottom | () | method |
| setIndexTop | () | method |
| toggle | () | method |
public function toggle(name:String = null):ASQueryObject切换Boolean类型的属性状态
Parameters
name:String (default = null) — 要切换的属性名,如果不传默认visible属性
|
ASQueryObject —
|
| toString | () | method |
public function toString():String输出字符串
ReturnsString —
|
| touch | () | method |
public function touch(handler:Function):ASQueryObject绑定touch事件
Parameters
handler:Function |
ASQueryObject —
|
| touchBegin | () | method |
public function touchBegin(handler:Function):ASQueryObject绑定Touch Begin事件
Parameters
handler:Function |
ASQueryObject —
|
| touchEnd | () | method |
public function touchEnd(handler:Function):ASQueryObject绑定Touch End事件
Parameters
handler:Function |
ASQueryObject —
|
| touchHover | () | method |
public function touchHover(handler:Function):ASQueryObject绑定Touch Hover事件
Parameters
handler:Function |
ASQueryObject —
|
| touchMove | () | method |
public function touchMove(handler:Function):ASQueryObject绑定Touch Move事件
Parameters
handler:Function |
ASQueryObject —
|
| trigger | () | method |
public function trigger(event:Event):ASQueryObject触发事件
Parameters
event:Event — 要触发的事件
|
ASQueryObject |
| unbind | () | method |
public function unbind(type:String = null, handler:Function = null):ASQueryObject解除事件监听 释放时可以不用显示调用此语句,因为Starling的dispose方法会清除所有子对象的监听。
Parameters
type:String (default = null) — 类型,如果不传,删除所有事件监听
| |
handler:Function (default = null) — 函数,如果不传,删除所有本类型监听函数
|
ASQueryObject —
|