AsWing源码简析(1)
ASWing 源码简析
?
?
继承及子类关系:?
=======================
AWSprite?
?flash.display.Sprite
?
subClass?Component
=======================
?
简析:
?
?
?
?
?
?
?
?
?
?
?
关于 root1 & ground_mc 是什么 稍后再了解
?
==========================================
2. ?当设定usingBitmap的值为 true 时, 会将改父元素所有层中的显示元素都放置到content中;
?
?? ? 当设定usingBitmap的值为 false时, 会将content中的所有显示都拿出来按顺序放置到父元素中.
?
==========================================
?
3. AWSprite 重写了 Sprite 的 addChild() , addChildAt(), removeChild(), removeChildAt(), getChildAt(),?getChildByName(),?getChildIndex(),?setChildIndex(),?swapChildren(),?swapChildrenAt(),
numChildren()
?
?? ?主要用于判断当前是否选择了?usingBitmap 模式, 应该去c操作哪里的子元素.
?
?? ?其中以addChild重写得较多. 主要判断是否 存在前景元素、是否选择了usingBitmap模式的不同状态下增加子元素的
情况。
?
===========================================
?
4. 增加获取层数的方法:
?
?
ReleaseEvent.RELEASEReleaseEvent.RELEASE_OUT_SIDE?
?? ?当鼠标在当前元素及子元素上触发 MouseDown事件的时候, 此类会记录当前的事件的发起者, 同时给Stage注册一个MouseUp的监听器。
?
?? ?当鼠标在这之后触发MouseUp事, 程序会判断MouseUp的发起者是否是,MouseDown事件的发起者或者其父元素。
?
?? ?如果都不是,则说明Release这个事件是在离开MouseDown发起者有效范围的事件。
?
?? ?在MouseUp后,会发起ReleaseEvent.RELEASE,
?
?? ?如果是离开MouseDown发起者有效范围的则同时还会发起一个ReleaseEvent.RELEASE_OUT_SIDE事件。