チェンジセット 196

差分発生行の前後
無視リスト:
コミット日時:
2008/01/13 03:16:38 (4 年前)
コミッタ:
nitoyon
ログメッセージ:

--

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/as3Query/samples/Test.as

    r184 r196  
    77        import test.Circle; Circle; 
    88        import test.Circle2; Circle2; 
    9         import com.nitoyon.aquery.*; 
     9        import com.nitoyon.as3query.*; 
    1010         
    1111        public class Test extends Sprite 
  • as3/as3Query/samples/test/Circle.as

    r182 r196  
    11package test 
    22{ 
    3         import flash.display.*; 
    4  
    5         public class Circle extends Sprite 
     3        public class Circle extends Base 
    64        { 
    7                 public function Circle() 
     5                internal override function drawShape():void 
    86                { 
    9                         graphics.beginFill(0xff0000); 
    10                         graphics.drawCircle(25, 25, 25); 
    11                         graphics.endFill(); 
     7                        graphics.drawEllipse(0, 0, width, height); 
    128                } 
    139        } 
  • as3/as3Query/src/com/nitoyon/as3query/$.as

    r183 r196  
    1 package com.nitoyon.aquery { 
    2         public function $(... args):aQuery { 
    3                 return aQuery.create(args[0], args[1]); 
     1package com.nitoyon.as3query { 
     2        public function $(... args):as3Query { 
     3                return as3Query.create(args[0], args[1]); 
    44        } 
    55} 
  • as3/as3Query/src/com/nitoyon/as3query/Dom.as

    r186 r196  
    1 package com.nitoyon.aquery { 
     1package com.nitoyon.as3query { 
    22import flash.utils.getQualifiedClassName; 
     3import flash.utils.Dictionary; 
    34import flash.display.DisplayObject; 
    45import flash.display.DisplayObjectContainer; 
     
    910                        var c:DisplayObjectContainer = DisplayObjectContainer(node); 
    1011                        return c.numChildren ? c.getChildAt(0) : null; 
     12                } 
     13 
     14                return null; 
     15        } 
     16 
     17        static public function lastChild( node:DisplayObject):DisplayObject { 
     18                if ( node is DisplayObjectContainer ) { 
     19                        var c:DisplayObjectContainer = DisplayObjectContainer(node); 
     20                        return c.numChildren ? c.getChildAt(c.numChildren - 1) : null; 
    1121                } 
    1222 
     
    2636        } 
    2737 
     38        static internal function getProperty( node:DisplayObject, prop:String ):Object { 
     39                return /firstChild|nextSibling|previousSibling/.test(prop) ? Dom[prop]( node ) : 
     40                        node.hasOwnProperty(prop) ? node[prop] : null; 
     41        } 
     42 
    2843        static public function nodeName( node:DisplayObject ):String { 
    2944                return getQualifiedClassName( node ).replace(/.*::/, ""); 
     
    3449        } 
    3550 
     51        static private var idList:Dictionary = new Dictionary( false ); 
     52 
     53        static internal function registerId( id:String, obj:DisplayObject ):void { 
     54                idList[ id ] = obj; 
     55        } 
     56 
     57        static internal function unregisterId( id:String ):void { 
     58                if( idList.hasOwnProperty( id )) 
     59                        delete idList[ id ]; 
     60        } 
     61 
     62        static public function getElementById( id:String ):DisplayObject { 
     63                return idList[ id ]; 
     64        } 
     65 
    3666        static public function getElementsByTagName( tagName:String, parent:DisplayObject = null, arr:Array = null ):Array { 
    37                 parent = parent || aQuery.stage; 
     67                parent = parent || as3Query.stage; 
    3868                arr = arr || []; 
    3969 
     
    4373                                var n:DisplayObject = p.getChildAt( i ); 
    4474 
    45                                 if ( nodeNameCmp( n, tagName ) ) 
     75                                if ( tagName == "*" || nodeNameCmp( n, tagName ) ) 
    4676                                        arr.push( n ); 
    4777                                if ( n is DisplayObjectContainer) 
     
    5282                return arr; 
    5383        } 
    54  
    55         static public function getProperty( node:DisplayObject, prop:String ):Object { 
    56                 return /firstChild|nextSibling|previousSibling/.test(prop) ? Dom[prop]( node ) : 
    57                         node.hasOwnProperty(prop) ? node[prop] : null; 
    58         } 
    5984} 
    6085} 
  • as3/as3Query/src/com/nitoyon/as3query/as3Query.as

    r186 r196  
    1 package com.nitoyon.aquery { 
     1package com.nitoyon.as3query { 
    22import flash.utils.Proxy; 
    33import flash.utils.flash_proxy; 
    44import flash.utils.getDefinitionByName; 
    55import flash.utils.getQualifiedClassName; 
    6 import flash.utils.ByteArray; 
    76import flash.utils.Dictionary; 
    87import flash.events.Event; 
    98import flash.net.registerClassAlias; 
    10 import flash.media.SoundTransform; 
    11 import flash.geom.Transform; 
    129import flash.display.DisplayObject; 
    1310import flash.display.DisplayObjectContainer; 
    1411import flash.display.Stage; 
    15 import com.nitoyon.aquery.aQueryFx; 
    16  
    17 public class aQuery extends Proxy { 
     12 
     13public class as3Query extends Proxy { 
    1814 
    1915        //-------------------------------------------------------------------------- 
     
    2521        private static var quickExpr:RegExp = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/; 
    2622 
    27         public function aQuery(array:Array) { 
     23        public function as3Query(array:Array) { 
    2824                setArray( array ); 
    2925        } 
     
    4137        } 
    4238 
    43         static public function create(... args):aQuery { 
     39        static public function create(... args):as3Query { 
    4440                var a:Object = args[0] || _stage; 
    4541                var c:Object = args[1]; 
     
    5046                                // HANDLE $(html) -> $(array) 
    5147                                if( m[ 1 ] ) { 
    52                                         a = aQuery.clean( [ m[1] ] ); 
     48                                        a = as3Query.clean( [ m[1] ] ); 
    5349                                // HANDLE: $("#id") 
    5450                                } else { 
    55                                         throw new Error(); 
     51                                        var tmp:DisplayObject = Dom.getElementById( m[3] ); 
     52                                        if ( tmp ){ 
     53                                                return new as3Query( [ tmp ] ); 
     54                                        } 
     55                                        else 
     56                                                a = []; 
    5657                                } 
    5758                        // HANDLE: $(expr) 
     
    6162                // HANDLE: $(function) 
    6263                // Shortcut for ??? 
    63                 } else if( aQuery.isFunction(a) ) { 
     64                } else if( as3Query.isFunction(a) ) { 
    6465                        throw new Error(); 
    6566                // HANDLE: $(XML) 
    6667                } else if( a is XML || a is XMLList ) { 
    67                         a = aQuery.clean( [ a ]); 
     68                        a = as3Query.clean( [ a ]); 
    6869                // HANDLE: $(Class) 
    6970                } else if( a is Class ) { 
     
    7273 
    7374                if ( a is Stage && !_stage) 
    74                         aQuery.stage = a as Stage; 
    75  
    76                 return new aQuery( 
     75                        as3Query.stage = a as Stage; 
     76 
     77                return new as3Query( 
    7778                        // HANDLE: $(array) 
    7879                        a is Array ? a as Array : 
    7980 
    8081                        // HANDLE: $(arraylike) 
    81                         a.hasOwnProperty("length") && a.hasOwnProperty(0) ? aQuery.makeArray(a) : 
     82                        a.hasOwnProperty("length") && a.hasOwnProperty(0) ? as3Query.makeArray(a) : 
    8283 
    8384                        // HANDLE: $(*) 
     
    100101 
    101102        public function toString():String { 
    102                 return "[aQuery " + _array.toString() + "]"; 
     103                return "[as3Query " + _array.toString() + "]"; 
    103104        } 
    104105 
     
    126127        public function getArray():Array { 
    127128                // Return a 'clean' array 
    128                 return aQuery.makeArray( this ); 
    129         } 
    130  
    131         private var prevObject:aQuery = null; 
    132         private function pushStack( a:Object ):aQuery { 
    133                 var ret:aQuery = aQuery.create(a); 
     129                return as3Query.makeArray( this ); 
     130        } 
     131 
     132        private var prevObject:as3Query = null; 
     133        private function pushStack( a:Object ):as3Query { 
     134                var ret:as3Query = as3Query.create(a); 
    134135                ret.prevObject = this; 
    135136                return ret; 
    136137        } 
    137138 
    138         private function setArray(a:Array):aQuery { 
     139        private function setArray(a:Array):as3Query { 
    139140                _array.push.apply(_array, a); 
    140141                return this; 
    141142        } 
    142143 
    143         public function each(fn:Function, args:Object = null):aQuery { 
    144                 return aQuery.each( this, fn, args ) as aQuery; 
     144        public function each(fn:Function, args:Object = null):as3Query { 
     145                return as3Query.each( this, fn, args ) as as3Query; 
    145146        } 
    146147 
     
    155156                if ( key is String ) 
    156157                        if ( value == null ) 
    157                                 return length && aQuery[type || "attr"](this[0], key) || undefined; 
     158                                return length && as3Query[type || "attr"](this[0], key) || undefined; 
    158159                        else { 
    159160                                obj = {}; 
     
    165166                        // Set all the styles 
    166167                        for ( var prop:String in obj ) 
    167                                 aQuery.attr( 
     168                                as3Query.attr( 
    168169                                        this, 
    169                                         prop, aQuery.prop(this, obj[prop], type, index, prop) 
     170                                        prop, as3Query.prop(this, obj[prop], type, index, prop) 
    170171                                ); 
    171172                }); 
     
    186187 
    187188                var t:String = ""; 
    188                 aQuery.each( e || this, function(index:int, val:Object):void { 
     189                as3Query.each( e || this, function(index:int, val:Object):void { 
    189190                        if( this.hasOwnProperty("text") ) { 
    190191                                t += this["text"].toString(); 
     
    194195        } 
    195196 
    196         public function wrapAll(html:String):aQuery { 
     197        public function wrapAll(html:String):as3Query { 
    197198                if ( this[0] ) 
    198199                        // The elements to wrap the target around 
    199                         aQuery.create(html, this[0].stage) 
     200                        as3Query.create(html, this[0].stage) 
    200201                                .clone() 
    201202                                .insertBefore(this[0]) 
     
    211212        } 
    212213 
    213         public function wrapInner(html:String):aQuery { 
     214        public function wrapInner(html:String):as3Query { 
    214215                return each(function(...args):void{ 
    215                         aQuery.create(this).contents().wrapAll(html); 
    216                 }); 
    217         } 
    218  
    219         public function wrap(html:String):aQuery { 
     216                        as3Query.create(this).contents().wrapAll(html); 
     217                }); 
     218        } 
     219 
     220        public function wrap(html:String):as3Query { 
    220221                return each(function(...args):void{ 
    221                         aQuery.create(this).wrapAll(html); 
     222                        as3Query.create(this).wrapAll(html); 
    222223                }); 
    223224        } 
     
    239240        }; 
    240241 
    241         public function parent( filter:String = null ):aQuery { 
     242        public function parent( filter:String = null ):as3Query { 
    242243                return mapAndPush(filter, function(a:DisplayObject, ...args):DisplayObject { 
    243244                        return a.parent; 
     
    245246        } 
    246247 
    247         public function parents( filter:String = null ):aQuery { 
     248        public function parents( filter:String = null ):as3Query { 
    248249                return mapAndPush(filter, function(a:DisplayObject, ...args):Array { 
    249                         return aQuery.dir(a, 'parent'); 
    250                 }); 
    251         } 
    252  
    253         public function next( filter:String = null ):aQuery { 
     250                        return as3Query.dir(a, 'parent'); 
     251                }); 
     252        } 
     253 
     254        public function next( filter:String = null ):as3Query { 
    254255                return mapAndPush(filter, function(a:DisplayObject, ...args):DisplayObject { 
    255                         return aQuery.nth(a, 2, 'nextSibling'); 
    256                 }); 
    257         } 
    258  
    259         public function prev( filter:String = null ):aQuery { 
     256                        return as3Query.nth(a, 2, 'nextSibling'); 
     257                }); 
     258        } 
     259 
     260        public function prev( filter:String = null ):as3Query { 
    260261                return mapAndPush(filter, function(a:DisplayObject, ...args):DisplayObject { 
    261                         return aQuery.nth(a, 2, 'previousSibling'); 
    262                 }); 
    263         } 
    264  
    265         public function nextAll( filter:String = null ):aQuery { 
     262                        return as3Query.nth(a, 2, 'previousSibling'); 
     263                }); 
     264        } 
     265 
     266        public function nextAll( filter:String = null ):as3Query { 
    266267                return mapAndPush(filter, function(a:DisplayObject, ...args):Array { 
    267                         return aQuery.dir(a, 'nextSibling'); 
    268                 }); 
    269         } 
    270  
    271         public function prevAll( filter:String = null ):aQuery { 
     268                        return as3Query.dir(a, 'nextSibling'); 
     269                }); 
     270        } 
     271 
     272        public function prevAll( filter:String = null ):as3Query { 
    272273                return mapAndPush(filter, function(a:DisplayObject, ...args):Array { 
    273                         return aQuery.dir(a, 'previousSibling'); 
    274                 }); 
    275         } 
    276  
    277         public function siblings( filter:String = null ):aQuery { 
     274                        return as3Query.dir(a, 'previousSibling'); 
     275                }); 
     276        } 
     277 
     278        public function siblings( filter:String = null ):as3Query { 
    278279                return mapAndPush(filter, function(a:DisplayObject, ...args):Array { 
    279                         return aQuery.sibling(a.parent.getChildAt(0), a); 
    280                 }); 
    281         } 
    282  
    283         public function children( filter:String = null ):aQuery { 
     280                        return as3Query.sibling(a.parent.getChildAt(0), a); 
     281                }); 
     282        } 
     283 
     284        public function children( filter:String = null ):as3Query { 
    284285                return mapAndPush(filter, function(a:DisplayObject, ...args):Array { 
    285                         return aQuery.sibling(Dom.firstChild(a)); 
    286                 }); 
    287         } 
    288  
    289         public function contents( filter:String = null ):aQuery { 
     286                        return as3Query.sibling(Dom.firstChild(a)); 
     287                }); 
     288        } 
     289 
     290        public function contents( filter:String = null ):as3Query { 
    290291                return mapAndPush(filter, function(a:DisplayObject, ...args):DisplayObject { 
    291292                        return a.root; 
     
    293294        } 
    294295 
    295         private function mapAndPush( a:String, fn:Function ):aQuery { 
    296                 var ret:Array = aQuery.map( this, fn ); 
     296        private function mapAndPush( a:String, fn:Function ):as3Query { 
     297                var ret:Array = as3Query.map( this, fn ); 
    297298                if ( a ) 
    298                         ret = aQuery.multiFilter(a, ret.getArray()); 
    299                 return pushStack(aQuery.unique(ret)); 
    300         } 
    301  
    302         public function append(... args):aQuery { 
     299                        ret = as3Query.multiFilter(a, ret.getArray()); 
     300                return pushStack(as3Query.unique(ret)); 
     301        } 
     302 
     303        public function append(... args):as3Query { 
    303304                return domManip(args, true, 1, function(a:DisplayObject):void{ 
    304305                        this.addChild( a ); 
     
    306307        } 
    307308 
    308         public function prepend(... args):aQuery { 
     309        public function prepend(... args):as3Query { 
    309310                return domManip(args, true, -1, function(a:DisplayObject):void{ 
    310311                        this.addChildAt( a, 0 ); 
     
    312313        } 
    313314         
    314         public function before(... args):aQuery { 
     315        public function before(... args):as3Query { 
    315316                return this.domManip(args, false, 1, function(a:DisplayObject):void{ 
    316317                        this.parent.addChildAt( a, this.parent.getChildIndex( this ) ); 
     
    318319        } 
    319320 
    320         public function after(... args):aQuery { 
     321        public function after(... args):as3Query { 
    321322                return this.domManip(args, false, -1, function(a:DisplayObject):void{ 
    322323                        this.parent.addChildAt( a, this.parent.getChildIndex( this ) + 1 ); 
     
    324325        } 
    325326 
    326         public function end():aQuery { 
    327                 return prevObject || aQuery.create([]); 
    328         } 
    329  
    330         public function find(t:*):aQuery { 
    331                 var data:Array = aQuery.map(this, function(a:DisplayObject, ...args):Array{ return aQuery.find(t,a); }); 
     327        public function end():as3Query { 
     328                return prevObject || as3Query.create([]); 
     329        } 
     330 
     331        public function find(t:*):as3Query { 
     332                var data:Array = as3Query.map(this, function(a:DisplayObject, ...args):Array{ return as3Query.find(t,a); }); 
    332333                return pushStack( /[^+>] [^+>]/.test( t ) || t.indexOf("..") > -1 ? 
    333                         aQuery.unique( data ) : data ); 
    334         } 
    335  
    336         public function clone(events:Boolean = false):aQuery { 
     334                        as3Query.unique( data ) : data ); 
     335        } 
     336 
     337        public function clone(events:Boolean = false):as3Query { 
    337338                // Do the clone 
    338                 var ret:aQuery = map(function(...args):DisplayObject{ 
    339                         return aQuery.cloneObject(this) as DisplayObject; 
     339                var ret:as3Query = map(function(...args):DisplayObject{ 
     340                        return as3Query.cloneObject(this) as DisplayObject; 
    340341                }); 
    341342                 
    342343                if (events === true) { 
    343                         var clone:aQuery = ret.find("*").andSelf(); 
     344                        var clone:as3Query = ret.find("*").andSelf(); 
    344345 
    345346                        find("*").andSelf().each(function(i:int, ...args):void { 
    346                                 var events:Object = aQuery.data(this, "events"); 
     347                                var events:Object = as3Query.data(this, "events"); 
    347348                                for ( var type:String in events ) 
    348349                                        for ( var handler:Object in events[type] ) 
    349                                                 aQueryEvent.add(clone[i], type, events[type][handler], events[type][handler].data); 
     350                                                as3QueryEvent.add(clone[i], type, events[type][handler], events[type][handler].data); 
    350351                        }); 
    351352                } 
     
    355356        } 
    356357 
    357         public function filter(t:Object):aQuery { 
     358        public function filter(t:Object):as3Query { 
    358359                return pushStack( 
    359                         aQuery.isFunction( t ) && 
    360                         aQuery.grep(this, function(el:Object, index:int):Object{ 
     360                        as3Query.isFunction( t ) && 
     361                        as3Query.grep(this, function(el:Object, index:int):Object{ 
    361362                                return t.apply(el, [index]); 
    362363                        }) || 
    363364 
    364                         aQuery.multiFilter(t.toString(),_array) ); 
    365         } 
    366  
    367         public function not(t:Object):aQuery { 
     365                        as3Query.multiFilter(t.toString(),_array) ); 
     366        } 
     367 
     368        public function not(t:Object):as3Query { 
    368369                return pushStack( 
    369370                        t is String && 
    370                         aQuery.multiFilter(t as String, _array, true) || 
    371  
    372                         aQuery.grep(this, function(a:Object):Boolean { 
    373                                 return ( t is Array ? aQuery.inArray( a, t as Array ) < 0 :  
    374                                          t is aQuery ? aQuery.inArray( a, t._array ) < 0 : a != t); 
     371                        as3Query.multiFilter(t as String, _array, true) || 
     372 
     373                        as3Query.grep(this, function(a:Object):Boolean { 
     374                                return ( t is Array ? as3Query.inArray( a, t as Array ) < 0 :  
     375                                         t is as3Query ? as3Query.inArray( a, t._array ) < 0 : a != t); 
    375376                        }) 
    376377                ); 
    377378        } 
    378379 
    379         public function add(t:Object):aQuery { 
    380                 return pushStack( aQuery.merge( 
     380        public function add(t:Object):as3Query { 
     381                return pushStack( as3Query.merge( 
    381382                        get() as Array, 
    382383                        t is String ? 
    383                                 aQuery(t).get() as Array : 
     384                                as3Query(t).get() as Array : 
    384385                                t is Array ? t as Array :  
    385                                 t is aQuery ? t.get() as Array : [t] ) 
     386                                t is as3Query ? t.get() as Array : [t] ) 
    386387                ); 
    387388        } 
    388389 
    389390        public function _is(expr:String):Boolean { 
    390                 return expr ? aQuery.multiFilter(expr, _array).length > 0 : false; 
     391                return expr ? as3Query.multiFilter(expr, _array).length > 0 : false; 
    391392        } 
    392393 
     
    399400                        if ( this.length ) { 
    400401                                var elem = this[0]; 
    401                        
     402                       
    402403                                // We need to handle select boxes special 
    403                                 if ( aQuery.nodeName(elem, "select") ) { 
     404                                if ( as3Query.nodeName(elem, "select") ) { 
    404405                                        var index = elem.selectedIndex, 
    405406                                                a = [], 
     
    416417                                                if ( option.selected ) { 
    417418                                                        // Get the specifc value for the option 
    418                                                         var val = aQuery.browser.msie && !option.attributes["value"].specified ? option.text : option.value; 
     419                                                        var val = as3Query.browser.msie && !option.attributes["value"].specified ? option.text : option.value; 
    419420                                                         
    420421                                                        // We don't need an array for one selects 
     
    436437                        return this.each(function(){ 
    437438                                if ( val.constructor == Array && /radio|checkbox/.test(this.type) ) 
    438                                         this.checked = (aQuery.inArray(this.value, val) >= 0 || 
    439                                                 aQuery.inArray(this.name, val) >= 0); 
    440                                 else if ( aQuery.nodeName(this, "select") ) { 
     439                                        this.checked = (as3Query.inArray(this.value, val) >= 0 || 
     440                                                as3Query.inArray(this.name, val) >= 0); 
     441                                else if ( as3Query.nodeName(this, "select") ) { 
    441442                                        var tmp = val.constructor == Array ? val : [val]; 
    442443 
    443                                         aQuery("option", this).each(function(){ 
    444                                                 this.selected = (aQuery.inArray(this.value, tmp) >= 0 || 
    445                                                 aQuery.inArray(this.text, tmp) >= 0); 
     444                                        as3Query("option", this).each(function(){ 
     445                                                this.selected = (as3Query.inArray(this.value, tmp) >= 0 || 
     446                                                as3Query.inArray(this.text, tmp) >= 0); 
    446447                                        }); 
    447448 
     
    463464        } 
    464465 
    465         public function replaceWith( val:Object ):aQuery { 
     466        public function replaceWith( val:Object ):as3Query { 
    466467                return after( val ).remove(); 
    467468        } 
    468469 
    469         public function slice(...args):aQuery { 
     470        public function slice(...args):as3Query { 
    470471                return pushStack( _array.slice.apply( this, args ) ); 
    471472        } 
    472473 
    473         public function map(fn:Function):aQuery { 
    474                 return pushStack(aQuery.map( this, function(elem:Object,i:int):Object{ 
     474        public function map(fn:Function):as3Query { 
     475                return pushStack(as3Query.map( this, function(elem:Object,i:int):Object{ 
    475476                        return fn.call( elem, i, elem ); 
    476477                })); 
    477478        } 
    478479 
    479         public function andSelf():aQuery { 
     480        public function andSelf():as3Query { 
    480481                return add( prevObject ); 
    481482        } 
    482483 
    483         public function domManip(args:Array, table:Boolean, dir:int, fn:Function):aQuery { 
    484                 // this -> Sprite 
    485                 // args -> aQuery ( "TextField" ) 
     484        public function domManip(args:Array, table:Boolean, dir:int, fn:Function):as3Query { 
    486485                var clone:Boolean = length > 1, a:Array;  
    487486 
    488487                return each(function():void{ 
    489488                        if ( !a ) { 
    490                                 a = aQuery.clean(args); 
     489                                a = as3Query.clean(args); 
    491490                                if ( dir < 0 ) 
    492491                                        a.reverse(); 
    493492                        } 
    494493 
    495                         var obj:aQuery = this; 
    496  
    497                         aQuery.each( a, function():void{ 
    498                                 fn.apply( obj, [ clone ? aQuery.cloneObject(this) : this ] ); 
     494                        var obj:as3Query = this; 
     495 
     496                        as3Query.each( a, function():void{ 
     497                                fn.apply( obj, [ clone ? as3Query.cloneObject(this) : this ] ); 
    499498                        }); 
    500                 }) as aQuery; 
     499                }) as as3Query; 
    501500        } 
    502501 
     
    514513 
    515514        public function extend( ...args ):Object { 
    516                 return aQuery.extend.apply( null, args ); 
     515                return as3Query.extend.apply( null, args ); 
    517516        } 
    518517 
     
    540539                                        // Recurse if we're merging object values 
    541540                                        if ( deep && prop[i] is Object && target[i] ) 
    542                                                 aQuery.extend( target[i], prop[i] ); 
     541                                                as3Query.extend( target[i], prop[i] ); 
    543542 
    544543                                        // Don't bring in undefined values 
     
    551550        } 
    552551 
    553         private static var expando:String = "aQuery" + (new Date()).getTime(); 
     552        private static var expando:String = "as3Query" + (new Date()).getTime(); 
    554553 
    555554        static public function isFunction(fn:Object):Boolean 
     
    568567        } 
    569568 
    570         static private var cache:Dictionary = new Dictionary(); 
     569        static private var cache:Dictionary = new Dictionary( false ); 
    571570 
    572571        static internal function data( elem:Object, name:String = "", data:Object = null ):Object { 
     
    578577                // Prevent overriding the named cache with undefined values 
    579578                if ( data != null ) 
    580                         aQuery.cache[ elem ][ name ] = data; 
     579                        as3Query.cache[ elem ][ name ] = data; 
    581580                 
    582581                // Return the named cache data 
     
    587586                // If we want to remove a specific section of the element's data 
    588587                if ( name != "" ) { 
    589                         if ( aQuery.cache[ elem ] ) { 
     588                        if ( as3Query.cache[ elem ] ) { 
    590589                                // Remove the section of cache data 
    591                                 delete aQuery.cache[ elem ][ name ]; 
     590                                delete as3Query.cache[ elem ][ name ]; 
    592591 
    593592                                // If we've removed all the data, remove the element's cache 
    594593                                name = ""; 
    595                                 for ( name in aQuery.cache[ elem ] ) break; 
     594                                for ( name in as3Query.cache[ elem ] ) break; 
    596595                                if ( name != "" ) 
    597                                         aQuery.removeData( elem ); 
     596                                        as3Query.removeData( elem ); 
    598597                        } 
    599598 
     
    601600                } else { 
    602601                        // Clean up the element expando 
    603                         delete aQuery.cache[ elem ]; 
     602                        delete as3Query.cache[ elem ]; 
    604603                } 
    605604        } 
     
    633632        static public function prop(elem:Object, value:Object, type:Object, index:int, prop:Object):Object { 
    634633                // Handle executable functions 
    635                 if(aQuery.isFunction(value)) 
     634                if(as3Query.isFunction(value)) 
    636635                        value = Function(value).call(elem, [index]); 
    637636 
     
    643642                // internal only, use addClass("class") 
    644643                add: function( elem, c ){ 
    645                         aQuery.each( (c || "").split(/\s+/), function(i, cur){ 
    646                                 if ( !aQuery.className.has( elem.className, cur ) ) 
     644                        as3Query.each( (c || "").split(/\s+/), function(i, cur){ 
     645                                if ( !as3Query.className.has( elem.className, cur ) ) 
    647646                                        elem.className += ( elem.className ? " " : "" ) + cur; 
    648647                        }); 
     
    652651                remove: function( elem, c ){ 
    653652                        elem.className = c != undefined ? 
    654                                 aQuery.grep( elem.className.split(/\s+/), function(cur){ 
    655                                         return !aQuery.className.has( c, cur );        
     653                                as3Query.grep( elem.className.split(/\s+/), function(cur){ 
     654                                        return !as3Query.className.has( c, cur );      
    656655                                }).join(" ") : ""; 
    657656                }, 
     
    659658                // internal only, use is(".class") 
    660659                has: function( t, c ) { 
    661                         return aQuery.inArray( c, (t.className || t).toString().split(/\s+/) ) > -1; 
     660                        return as3Query.inArray( c, (t.className || t).toString().split(/\s+/) ) > -1; 
    662661                } 
    663662        }, 
     
    677676                        var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"]; 
    678677 
    679                         aQuery.each( d, function(){ 
     678                        as3Query.each( d, function(){ 
    680679                                old["padding" + this] = 0; 
    681680                                old["border" + this + "Width"] = 0; 
    682681                        }); 
    683682 
    684                         aQuery.swap( e, old, function() { 
    685                                 if ( aQuery(e).is(':visible') ) { 
     683                        as3Query.swap( e, old, function() { 
     684                                if ( as3Query(e).is(':visible') ) { 
    686685                                        oHeight = e.offsetHeight; 
    687686                                        oWidth = e.offsetWidth; 
    688687                                } else { 
    689                                         e = aQuery(e.cloneNode(true)) 
     688                                        e = as3Query(e.cloneNode(true)) 
    690689                                                .find(":radio").removeAttr("checked").end() 
    691690                                                .css({ 
     
    693692                                                }).appendTo(e.parentNode)[0]; 
    694693 
    695                                         var parPos = aQuery.css(e.parentNode,"position") || "static"; 
     694                                        var parPos = as3Query.css(e.parentNode,"position") || "static"; 
    696695                                        if ( parPos == "static" ) 
    697696                                                e.parentNode.style.position = "relative"; 
     
    710709                } 
    711710 
    712                 return aQuery.curCSS( e, p ); 
     711                return as3Query.curCSS( e, p ); 
    713712        }, 
    714713 
     
    718717                // A helper method for determining if an element's values are broken 
    719718                function color(a){ 
    720                         if ( !aQuery.browser.safari ) 
     719                        if ( !as3Query.browser.safari ) 
    721720                                return false; 
    722721 
     
    725724                } 
    726725 
    727                 if (prop == "opacity" && aQuery.browser.msie) { 
    728                         ret = aQuery.attr(elem.style, "opacity"); 
     726                if (prop == "opacity" && as3Query.browser.msie) { 
     727                        ret = as3Query.attr(elem.style, "opacity"); 
    729728                        return ret == "" ? "1" : ret; 
    730729                } 
     
    803802                var r:Array = []; 
    804803 
    805                 aQuery.each( a, function(i:int,arg:Object):void{ 
     804                as3Query.each( a, function(i:int,arg:Object):void{ 
    806805                        if ( !arg ) return; 
    807806 
     
    860859 
    861860                        if ( arg ) 
    862                                 if( !arg.hasOwnProperty(0) ) 
     861                                if( !(arg is Array) ) 
    863862                                        r.push( arg ); 
    864863                                else 
    865                                         r = aQuery.merge( r, aQuery.makeArray( arg ) ); 
     864                                        r = as3Query.merge( r, as3Query.makeArray( arg ) ); 
    866865                }); 
    867866 
     
    870869 
    871870        static public function attr( elem:Object, name:String, value:Object = null ):Object { 
     871                // special case "id" 
     872                if( elem is DisplayObject && name == "id" ) 
     873                        if( value != null && value is String ) { 
     874                                Dom.registerId( value.toString(), DisplayObject(elem) ); 
     875                                as3Query.data( elem, "id", value ); 
     876                                return value; 
     877                        } 
     878                        else 
     879                                return as3Query.data( elem, "id" ); 
     880 
     881                if( !elem.hasOwnProperty( name ) ) 
     882                        return null; 
     883 
    872884                if( value != null ) 
    873885                        elem[name] = value; 
     
    947959        } 
    948960 
    949         public function appendTo(... args):aQuery { 
     961        public function appendTo(... args):as3Query { 
    950962                return argCall("append", args); 
    951963        } 
    952964 
    953         public function prependTo(... args):aQuery { 
     965        public function prependTo(... args):as3Query { 
    954966                return argCall("prepend", args); 
    955967        } 
    956968 
    957         public function insertBefore(... args):aQuery { 
     969        public function insertBefore(... args):as3Query { 
    958970                return argCall("before", args); 
    959971        } 
    960972 
    961         public function insertAfter(... args):aQuery { 
     973        public function insertAfter(... args):as3Query { 
    962974                return argCall("after", args); 
    963975        } 
    964976 
    965         public function replaceAll(... args):aQuery { 
     977        public function replaceAll(... args):as3Query { 
    966978                return argCall("replaceWith", args); 
    967979        } 
    968980 
    969         private function argCall(n:String, args:Array):aQuery 
     981        private function argCall(n:String, args:Array):as3Query 
    970982        { 
    971983                return each(function():void{ 
    972984                        for ( var i:int = 0, al:int = args.length; i < al; i++) 
    973                                 (aQuery.create(args[i]))[n]( this ); 
    974                 }); 
    975         } 
    976  
    977         public function removeAttr( key:String ):aQuery { 
     985                                (as3Query.create(args[i]))[n]( this ); 
     986                }); 
     987        } 
     988 
     989        public function removeAttr( key:String ):as3Query { 
    978990                return each( function( a:Object, v:Object = null ):void { 
    979991                        delete this[ key ]; 
     
    9921004        },*/ 
    9931005 
    994         public function remove( a:String = null ):aQuery { 
     1006        public function remove( a:String = null ):as3Query { 
    9951007                return each( function( ...args ):void { 
    996                         if ( !a || aQuery.filter( a, [this] ).r.length ) { 
    997                                 aQuery.removeData( this ); 
     1008                        if ( !a || as3Query.filter( a, [this] ).r.length ) { 
     1009                                as3Query.removeData( this ); 
    9981010                                this.parent.removeChild( this ); 
    9991011                        } 
     
    10401052 
    10411053                        // Child Checks 
    1042 /*                     "first-child": function(a:DisplayObject,i:int){return a.parentNode.getElementsByTagName('*')[0]==a}, 
    1043                         "last-child": function(a:DisplayObject,i:int){return aQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a}, 
    1044                         "only-child": function(a:DisplayObject,i:int){return !aQuery.nth(a.parentNode.lastChild,2,'previousSibling')}, 
    1045 */ 
     1054                       "first-child": function(a:DisplayObject, ...args):Boolean{return Dom.firstChild(a.parent)==a}, 
     1055                        "last-child": function(a:DisplayObject, ...args):Boolean{return Dom.lastChild(a.parent)==a}, 
     1056                        "only-child": function(a:DisplayObject, ...args):Boolean{return a.parent.numChildren == 1}, 
     1057 
    10461058                        // Parent Checks 
    1047                         parent: function(a:DisplayObject,i:int, m:Array, r:Array):Boolean{return a is DisplayObjectContainer ? DisplayObjectContainer(a).numChildren != 0 : false}, 
    1048                         empty:  function(a:DisplayObject,i:int, m:Array, r:Array):Boolean{return a is DisplayObjectContainer ? DisplayObjectContainer(a).numChildren == 0 : false}, 
     1059                        parent: function(a:DisplayObject,i:int, m:Array, r:Array):Boolean{return !!Dom.firstChild(a)}, 
     1060                        empty:  function(a:DisplayObject,i:int, m:Array, r:Array):Boolean{return !Dom.firstChild(a)}, 
     1061                        root:   function(a:DisplayObject,i:int, m:Array, r:Array):Boolean{return !a.parent}, 
    10491062 
    10501063                        // Text Check 
     
    10591072                        disabled: function(a:DisplayObject,i:int){return a.disabled}, 
    10601073                        checked: function(a:DisplayObject,i:int){return a.checked}, 
    1061                         selected: function(a:DisplayObject,i:int){return a.selected||aQuery.attr(a,'selected')}, 
     1074                        selected: function(a:DisplayObject,i:int){return a.selected||as3Query.attr(a,'selected')}, 
    10621075*/ 
    10631076                        // Form elements 
     
    10701083                        image: function(a:DisplayObject,i:int){return 'image'==a.type}, 
    10711084                        reset: function(a:DisplayObject,i:int){return 'reset'==a.type}, 
    1072                         button: '"button"==a.type||aQuery.nodeName(a,"button")', 
     1085                        button: '"button"==a.type||as3Query.nodeName(a,"button")', 
    10731086                        input: function(a:DisplayObject,i:int){return (/input|select|textarea|button/i).test(a.nodeName)}, 
    10741087*/ 
    10751088                        // :has() 
    1076                         has: function(a:DisplayObject,i:int, m:Array, r:Array):Boolean{return aQuery.find(m[3],a).length != 0}, 
     1089                        has: function(a:DisplayObject,i:int, m:Array, r:Array):Boolean{return as3Query.find(m[3],a).length != 0}, 
    10771090 
    10781091                        // :header 
     
    10801093 
    10811094                        // :animated 
    1082                         //animated: function(a:DisplayObject,...args):Boolean{return aQuery.grep(aQuery.timers,function(fn,...args){return a==fn.elem;}).length}*/ 
     1095                        //animated: function(a:DisplayObject,...args):Boolean{return as3Query.grep(as3Query.timers,function(fn,...args){return a==fn.elem;}).length}*/ 
    10831096                } 
    10841097        }; 
     
    11011114                while ( expr && expr != old ) { 
    11021115                        old = expr; 
    1103                         var f:Object = aQuery.filter( expr, elems, not ); 
     1116                        var f:Object = as3Query.filter( expr, elems, not ); 
    11041117                        expr = f.t.replace(/^\s*,\s*/, "" ); 
    1105                         cur = not ? elems = f.r : aQuery.merge( cur, f.r ); 
     1118                        cur = not ? elems = f.r : as3Query.merge( cur, f.r ); 
    11061119                } 
    11071120 
     
    11221135                        last = t; 
    11231136 
    1124                         t = aQuery.trim(t); 
     1137                        t = as3Query.trim(t); 
    11251138 
    11261139                        var foundToken:Boolean = false; 
     
    11491162                                if ( (m = re.exec(t)) != null ) { 
    11501163                                        r = []; 
    1151                                         nodeName = m[2] 
     1164                                        nodeName = m[2]; 
    11521165 
    11531166                                        var merge:Dictionary = new Dictionary(); 
     
    11561169                                        for ( var j:int = 0, rl:int = ret.length; j < rl; j++ ) { 
    11571170                                                var n:DisplayObject = m1 == "~" || m1 == "+" ? Dom.nextSibling(ret[j]) : Dom.firstChild(ret[j]); 
    1158                                                 for ( ; n; n = Dom.nextSibling(n) ) 
     1171                                                for ( ; n; n = Dom.nextSibling(n) ){ 
    11591172                                                        if ( m1 == "~" && merge[n] ) break; 
    1160                                                          
    1161                                                         if (!nodeName || Dom.nodeName(n).toUpperCase() == nodeName.toUpperCase() ) { 
     1173 
     1174                                                        if (!nodeName || Dom.nodeNameCmp(n, nodeName) ) { 
    11621175                                                                if ( m1 == "~" ) merge[n] = true; 
    11631176                                                                r.push( n ); 
    11641177                                                        } 
    1165                                                          
     1178 
    11661179                                                        if ( m1 == "+" ) break; 
     1180                                                } 
    11671181                                        } 
    11681182 
     
    11701184 
    11711185                                        // And remove the token 
    1172                                         t = aQuery.trim( t.replace( re, "" ) ); 
     1186                                        t = as3Query.trim( t.replace( re, "" ) ); 
    11731187                                        foundToken = true; 
    11741188                                } 
     
    11841198 
    11851199                                        // Merge the result sets 
    1186                                         done = aQuery.merge( done, ret ); 
     1200                                        done = as3Query.merge( done, ret ); 
    11871201 
    11881202                                        // Reset the context 
     
    12131227 
    12141228                                        // Try to do a global search by ID, where we can 
    1215                                         if ( m[1] == "#" ) {//&& elem && elem.getElementById && !aQuery.isXMLDoc(elem) ) { 
     1229                                        if ( m[1] == "#" ) {//&& elem && elem.getElementById && !as3Query.isXMLDoc(elem) ) { 
    12161230                                                throw new Error("not implemented"); 
    12171231                                                // Optimization for HTML document case 
     
    12201234                                                // Do a quick check for node name (where applicable) so 
    12211235                                                // that div#foo searches will be really fast 
    1222                                                 //ret = r = oid && (!m[3] || aQuery.nodeName(oid, m[3])) ? [oid] : []; 
     1236                                                //ret = r = oid && (!m[3] || as3Query.nodeName(oid, m[3])) ? [oid] : []; 
    12231237                                        } else { 
    12241238                                                // We need to find all descendant elements 
     
    12271241                                                        var tag:String = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2]; 
    12281242 
    1229                                                         r = aQuery.merge( r, Dom.getElementsByTagName( tag, ret[i] )); 
     1243                                                        r = as3Query.merge( r, Dom.getElementsByTagName( tag, ret[i] )); 
    12301244                                                } 
    12311245 
    12321246                                                // It's faster to filter by class and be done with it 
    12331247                                                if ( m[1] == "." ) 
    1234                                                         r = aQuery.classFilter( r, m[2] ); 
     1248                                                        r = as3Query.classFilter( r, m[2] ); 
    12351249 
    12361250                                                // Same with ID filtering 
     
    12591273                        if ( t ) { 
    12601274                                // Attempt to filter it 
    1261                                 var val:Object = aQuery.filter(t,r); 
     1275                                var val:Object = as3Query.filter(t,r); 
    12621276                                ret = r = val.r; 
    1263                                 t = aQuery.trim(val.t); 
     1277                                t = as3Query.trim(val.t); 
    12641278                        } 
    12651279                } 
     
    12751289 
    12761290                // And combine the results 
    1277                 done = aQuery.merge( done, ret ); 
     1291                done = as3Query.merge( done, ret ); 
    12781292 
    12791293                return done; 
     
    13011315                        last = t; 
    13021316 
    1303                         var p:Object = aQuery.parse, m:Array; 
     1317                        var p:Object = as3Query.parse, m:Array; 
    13041318 
    13051319                        for ( var i:int = 0; p[i]; i++ ) { 
     
    13211335                        // keeping it out of the expression list 
    13221336                        if ( m[1] == ":" && m[2] == "not" ) 
    1323                                 r = aQuery.filter(m[3], r, true).r; 
     1337                                r = as3Query.filter(m[3], r, true).r; 
    13241338 
    13251339                        // We can get a big speed boost by filtering by class here 
    13261340                        else if ( m[1] == "." ) 
    1327                                 r = aQuery.classFilter(r, m[2], not); 
     1341                                r = as3Query.classFilter(r, m[2], not); 
    13281342 
    13291343                        else if ( m[1] == "[" ) { 
     
    13321346                                var rl:int; 
    13331347                                for ( i = 0, rl = r.length; i < rl; i++ ) { 
    1334                                         var a:Object = r[i], z:Object = a[ aQuery.props[m[2]] || m[2] ]
     1348                                        var a:Object = r[i], z:Object = a.hasOwnProperty( m[2] ) ? a[ m[2] ] : null
    13351349                                         
    13361350                                        if ( z == null || /href|src|selected/.test(m[2]) ) 
    1337                                                 z = aQuery.attr(a,m[2]) || ''; 
     1351                                                z = as3Query.attr(a,m[2]) || ''; 
    13381352 
    13391353                                        if ( int(type == "" && !!z || 
     
    13881402                        // Otherwise, find the expression to execute 
    13891403                        } else { 
    1390                                 var f:Object = aQuery.expr[m[1]]; 
     1404                                var f:Object = as3Query.expr[m[1]]; 
    13911405                                if ( f is Object ) 
    1392                                         f = aQuery.expr[m[1]][m[2]]; 
     1406                                        f = as3Query.expr[m[1]][m[2]]; 
    13931407 
    13941408                                if(f is Function) { 
     
    13971411 
    13981412                                        // Execute it against the current filter 
    1399                                         r = aQuery.grep( r, ff, not ); 
     1413                                        r = as3Query.grep( r, ff, not ); 
    14001414                                } 
    14011415                        } 
     
    14451459        //-------------------------------------------------------------------------- 
    14461460 
    1447         public function bind( type:String, data:Object, fn:Object = null ):aQuery { 
     1461        public function bind( type:String, data:Object, fn:Object = null ):as3Query { 
    14481462                return each(function(... args):void{ 
    1449                         aQueryEvent.add( this, type, (fn || data) as Function, fn && data ); 
    1450                 }); 
    1451         } 
    1452  
    1453         public function one( type:String, data:Object, fn:Object = null ):aQuery { 
     1463                        as3QueryEvent.add( this, type, (fn || data) as Function, fn && data ); 
     1464                }); 
     1465        } 
     1466 
     1467        public function one( type:String, data:Object, fn:Object = null ):as3Query { 
    14541468                return each(function(... args):void { 
    1455                         aQueryEvent.add( this, type, function(event:Event):Object { 
    1456                                 (aQuery.create(this)).unbind(type, arguments.callee); 
     1469                        as3QueryEvent.add( this, type, function(event:Event):Object { 
     1470                                (as3Query.create(this)).unbind(type, arguments.callee); 
    14571471                                return ((fn || data) as Function).apply( this, arguments); 
    14581472                        }, fn && data); 
     
    14601474        } 
    14611475 
    1462         public function unbind( type:Object = null, fn:Function = null ):aQuery { 
     1476        public function unbind( type:Object = null, fn:Function = null ):as3Query { 
    14631477                return each(function(... args):void { 
    1464                         aQueryEvent.remove( this, type, fn ); 
    1465                 }); 
    1466         } 
    1467  
    1468         public function trigger( type:String, data:Array = null ):aQuery { 
     1478                        as3QueryEvent.remove( this, type, fn ); 
     1479                }); 
     1480        } 
     1481 
     1482        public function trigger( type:String, data:Array = null ):as3Query { 
    14691483                return this.each(function(...args):void { 
    1470                         aQueryEvent.trigger( type, data, this ); 
     1484                        as3QueryEvent.trigger( type, data, this ); 
    14711485                }); 
    14721486        } 
     
    14741488        public function triggerHandler( type:String, data:Array = null, fn:Function = null ):Object { 
    14751489                if ( this[0] ) 
    1476                         return aQueryEvent.trigger( type, data, this[0], false, fn ); 
     1490                        return as3QueryEvent.trigger( type, data, this[0], false, fn ); 
    14771491                return null; 
    14781492        } 
     
    14951509*/ 
    14961510 
    1497         public function focusOut    ( f:Function = null):aQuery { return eventImpl("focusOut", f);} 
    1498         public function focusIn     ( f:Function = null):aQuery { return eventImpl("focusIn", f);} 
    1499         public function resize      ( f:Function = null):aQuery { return eventImpl("resize", f);} 
    1500         public function scroll      ( f:Function = null):aQuery { return eventImpl("scroll", f);} 
    1501         public function click       ( f:Function = null):aQuery { return eventImpl("click", f);} 
    1502         public function doubleClick ( f:Function = null):aQuery { return eventImpl("doubleClick", f);} 
    1503         public function mouseDown   ( f:Function = null):aQuery { return eventImpl("mouseDown", f);} 
    1504         public function mouseUp     ( f:Function = null):aQuery { return eventImpl("mouseUp", f);} 
    1505         public function mouseMove   ( f:Function = null):aQuery { return eventImpl("mouseMove", f);} 
    1506         public function mouseOver   ( f:Function = null):aQuery { return eventImpl("mouseOver", f);} 
    1507         public function mouseOut    ( f:Function = null):aQuery { return eventImpl("mouseOut", f);} 
    1508         public function keyDown     ( f:Function = null):aQuery { return eventImpl("keyDown", f);} 
    1509         public function keyUp       ( f:Function = null):aQuery { return eventImpl("keyUp", f);} 
    1510         public function enterFrame  ( f:Function = null):aQuery { return eventImpl("enterFrame", f);} 
     1511        public function hover(f:Function, g:Function):as3Query { 
     1512 
     1513                // A private function for handling mouse 'hovering' 
     1514                function handleHover(e:Event):Object { 
     1515                        // Check if mouse(over|out) are still within the same parent element 
     1516                        //var p = e.relatedTarget; 
     1517         
     1518                        // Traverse up the tree 
     1519                        //while ( p && p != this ) try { p = p.parentNode; } catch(e) { p = this; }; 
     1520                         
     1521                        // If we actually just moused on to a sub-element, ignore it 
     1522                        //if ( p == this ) return false; 
     1523                         
     1524                        // Execute the right function 
     1525                        return (e.type == "mouseOver" ? f : g).apply(this, [e]); 
     1526                } 
     1527                 
     1528                // Bind the function to the two event listeners 
     1529                return this.mouseover(handleHover).mouseout(handleHover); 
     1530        } 
     1531 
     1532        public function focusOut    ( f:Function = null):as3Query { return eventImpl("focusOut", f);} 
     1533        public function focusIn     ( f:Function = null):as3Query { return eventImpl("focusIn", f);} 
     1534        public function resize      ( f:Function = null):as3Query { return eventImpl("resize", f);} 
     1535        public function scroll      ( f:Function = null):as3Query { return eventImpl("scroll", f);} 
     1536        public function click       ( f:Function = null):as3Query { return eventImpl("click", f);} 
     1537        public function doubleClick ( f:Function = null):as3Query { return eventImpl("doubleClick", f);} 
     1538        public function mouseDown   ( f:Function = null):as3Query { return eventImpl("mouseDown", f);} 
     1539        public function mouseUp     ( f:Function = null):as3Query { return eventImpl("mouseUp", f);} 
     1540        public function mouseMove   ( f:Function = null):as3Query { return eventImpl("mouseMove", f);} 
     1541        public function mouseOver   ( f:Function = null):as3Query { return eventImpl("mouseOver", f);} 
     1542        public function mouseOut    ( f:Function = null):as3Query { return eventImpl("mouseOut", f);} 
     1543        public function keyDown     ( f:Function = null):as3Query { return eventImpl("keyDown", f);} 
     1544        public function keyUp       ( f:Function = null):as3Query { return eventImpl("keyUp", f);} 
     1545        public function enterFrame  ( f:Function = null):as3Query { return eventImpl("enterFrame", f);} 
    15111546 
    15121547        // jQuery compatible methods 
    1513         public function focus    ( f:Function = null):aQuery { return focusIn(f);} 
    1514         public function blur     ( f:Function = null):aQuery { return focusOut(f);} 
    1515         public function dblclick ( f:Function = null):aQuery { return doubleClick(f);} 
    1516         public function mousedown( f:Function = null):aQuery { return mouseDown(f);} 
    1517         public function mouseup  ( f:Function = null):aQuery { return mouseUp(f);} 
    1518         public function mousemove( f:Function = null):aQuery { return mouseMove(f);} 
    1519         public function mouseout ( f:Function = null):aQuery { return mouseOut(f);} 
    1520         public function keydown  ( f:Function = null):aQuery { return keyDown(f);} 
    1521         public function keyup    ( f:Function = null):aQuery { return keyUp(f);} 
    1522  
    1523         private function eventImpl( type:String, f:Function = null):aQuery { 
     1548        public function focus    ( f:Function = null):as3Query { return focusIn(f);} 
     1549        public function blur     ( f:Function = null):as3Query { return focusOut(f);} 
     1550        public function dblclick ( f:Function = null):as3Query { return doubleClick(f);} 
     1551        public function mousedown( f:Function = null):as3Query { return mouseDown(f);} 
     1552        public function mouseup  ( f:Function = null):as3Query { return mouseUp(f);} 
     1553        public function mousemove( f:Function = null):as3Query { return mouseMove(f);} 
     1554        public function mouseover( f:Function = null):as3Query { return mouseOver(f);} 
     1555        public function mouseout ( f:Function = null):as3Query { return mouseOut(f);} 
     1556        public function keydown  ( f:Function = null):as3Query { return keyDown(f);} 
     1557        public function keyup    ( f:Function = null):as3Query { return keyUp(f);} 
     1558 
     1559        private function eventImpl( type:String, f:Function = null):as3Query { 
    15241560                return f != null ? bind(type, f) : trigger(type); 
    15251561        } 
     
    15311567        //-------------------------------------------------------------------------- 
    15321568 
    1533         public function addTween(obj:Object):aQuery { 
     1569        public function addTween(obj:Object):as3Query { 
    15341570                var tweener:Class = getDefinitionByName("caurina.transitions.Tweener") as Class; 
    15351571                if(tweener && tweener.addTween is Function) { 
     
    15391575        } 
    15401576 
    1541         public function show(speed:Number = 0, callback:Function = null):aQuery { 
     1577        public function show(speed:Number = 0, callback:Function = null):as3Query { 
    15421578                return speed ? 
    15431579                        animate({ 
     
    15491585        } 
    15501586         
    1551         public function hide(speed:Number = 0, callback:Function = null):aQuery { 
     1587        public function hide(speed:Number = 0, callback:Function = null):as3Query { 
    15521588                return speed ? 
    15531589                        animate({ 
     
    15591595        } 
    15601596 
    1561         public function toggle( fn:Object = null, fn2:Object = null ):aQuery { 
    1562                 //return //aQuery.isFunction(fn) && aQuery.isFunction(fn2) ? 
     1597        public function toggle( fn:Object = null, fn2:Object = null ):as3Query { 
     1598                //return //as3Query.isFunction(fn) && as3Query.isFunction(fn2) ? 
    15631599                        //_toggle( fn, fn2 ) : 
    15641600                return fn != null ? 
     
    15671603                                }, fn, fn2) : 
    15681604                        each(function(...args):void{ 
    1569                                 aQuery.create(this)[ aQuery.create(this)._is(":hidden") ? "show" : "hide" ](); 
     1605                                as3Query.create(this)[ as3Query.create(this)._is(":hidden") ? "show" : "hide" ](); 
    15701606                        }); 
    15711607        } 
    15721608         
    1573         public function slideDown(speed:Object,callback:Object = null):aQuery { 
     1609        public function slideDown(speed:Object,callback:Object = null):as3Query { 
    15741610                return animate({height: "show"}, speed, callback); 
    15751611        } 
    15761612         
    1577         public function slideUp(speed:Object,callback:Object = null):aQuery { 
     1613        public function slideUp(speed:Object,callback:Object = null):as3Query { 
    15781614                return animate({height: "hide"}, speed, callback); 
    15791615        } 
    15801616 
    1581         public function slideToggle(speed:Object, callback:Object = null):aQuery { 
     1617        public function slideToggle(speed:Object, callback:Object = null):as3Query { 
    15821618                return animate({height: "toggle"}, speed, callback); 
    15831619        } 
    15841620         
    1585         public function fadeIn(speed:Object, callback:Object = null):aQuery { 
     1621        public function fadeIn(speed:Object, callback:Object = null):as3Query { 
    15861622                return animate({alpha: "show"}, speed, callback); 
    15871623        } 
    15881624         
    1589         public function fadeOut(speed:Object, callback:Object = null):aQuery { 
     1625        public function fadeOut(speed:Object, callback:Object = null):as3Query { 
    15901626                return animate({alpha: "hide"}, speed, callback); 
    15911627        } 
    15921628         
    1593         public function fadeTo(speed:Object, to:Number, callback:Object = null):aQuery { 
     1629        public function fadeTo(speed:Object, to:Number, callback:Object = null):as3Query { 
    15941630                return animate({alpha: to}, speed, callback); 
    15951631        } 
    15961632 
    1597         public function animate( prop:Object, speed:Object, easing:Object, callback:Function = null ):aQuery { 
    1598                 var opt:Object = aQuery.speed(speed, easing, callback); 
     1633        public function animate( prop:Object, speed:Object, easing:Object, callback:Function = null ):as3Query { 
     1634                var opt:Object = as3Query.speed(speed, easing, callback); 
    15991635 
    16001636                return this[ opt.queue === false ? "each" : "queue" ](function(... args):Object { 
    1601                         opt = aQuery.extend({}, opt); 
    1602                         var hidden:Boolean = aQuery.create(this)._is(":hidden"), self:DisplayObject = this; 
     1637                        opt = as3Query.extend({}, opt); 
     1638                        var hidden:Boolean = as3Query.create(this)._is(":hidden"), self:DisplayObject = this; 
    16031639                         
    16041640                        for ( var p:String in prop ) { 
    16051641                                if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden ) 
    1606                                         return aQuery.isFunction(opt.complete) && opt.complete.apply(this); 
     1642                                        return as3Query.isFunction(opt.complete) && opt.complete.apply(this); 
    16071643 
    16081644                                if ( p == "height" || p == "width" ) { 
     
    16121648                        } 
    16131649 
    1614                         opt.curAnim = aQuery.extend({}, prop); 
     1650                        opt.curAnim = as3Query.extend({}, prop); 
    16151651                         
    1616                         aQuery.each( prop, function(name:String, val:Object):void { 
    1617                                 var e:aQueryFx = new aQueryFx( self, opt, name ); 
     1652                        as3Query.each( prop, function(name:String, val:Object):void { 
     1653                                var e:as3QueryFx = new as3QueryFx( self, opt, name ); 
    16181654 
    16191655                                if ( /toggle|show|hide/.test( val.toString() ) ) 
     
    16491685        } 
    16501686 
    1651         private function queue(type:Object, fn:Object = null):aQuery { 
     1687        private function queue(type:Object, fn:Object = null):as3Query { 
    16521688                if ( !fn ) { 
    16531689                        fn = type; 
     
    16571693                return each(function(... args):void { 
    16581694                        if ( fn is Array ) 
    1659                                 aQuery.queue(this, type.toString(), fn as Array); 
     1695                                as3Query.queue(this, type.toString(), fn as Array); 
    16601696                        else { 
    1661                                 aQuery.queue(this, type.toString()).push( fn ); 
     1697                                as3Query.queue(this, type.toString()).push( fn ); 
    16621698                         
    1663                                 if ( aQuery.queue(this, type.toString()).length == 1 ) 
     1699                                if ( as3Query.queue(this, type.toString()).length == 1 ) 
    16641700                                        fn.apply(this); 
    16651701                        } 
     
    16671703        } 
    16681704 
    1669         public function stop():aQuery { 
    1670                 var timers:Array = aQuery.timers; 
     1705        public function stop():as3Query { 
     1706                var timers:Array = as3Query.timers; 
    16711707 
    16721708                return each(function(...args):void { 
     
    16811717                        return []; 
    16821718 
    1683                 var q:Array = aQuery.data( elem, type + "queue" ) as Array; 
     1719                var q:Array = as3Query.data( elem, type + "queue" ) as Array; 
    16841720 
    16851721                if ( !q || array ) 
    1686                         q = aQuery.data( elem, type + "queue",  
    1687                                 array ? aQuery.makeArray(array) : [] ) as Array; 
     1722                        q = as3Query.data( elem, type + "queue",  
     1723                                array ? as3Query.makeArray(array) : [] ) as Array; 
    16881724 
    16891725                return q; 
    16901726        } 
    16911727 
    1692         public function dequeue(type:String = null):aQuery { 
     1728        public function dequeue(type:String = null):as3Query { 
    16931729                type = type || "fx"; 
    16941730 
    16951731                return each(function(... args):void{ 
    1696                         var q:Array = aQuery.queue(this, type); 
     1732                        var q:Array = as3Query.queue(this, type); 
    16971733 
    16981734                        q.shift(); 
     
    17061742                var opt:Object = speed && getQualifiedClassName(speed) == "Object" ? speed : { 
    17071743                        complete: fn || fn != null && easing ||  
    1708                                 aQuery.isFunction( speed ) && speed, 
     1744                                as3Query.isFunction( speed ) && speed, 
    17091745                        duration: speed, 
    17101746                        easing: fn && easing || easing && !(easing is Function) && easing 
     
    17171753                opt.old = opt.complete; 
    17181754                opt.complete = function():void{ 
    1719                         aQuery.create(this).dequeue(); 
    1720                         if ( aQuery.isFunction( opt.old ) ) 
     1755                        as3Query.create(this).dequeue(); 
     1756                        if ( as3Query.isFunction( opt.old ) ) 
    17211757                                opt.old.apply( this ); 
    17221758                }; 
  • as3/as3Query/src/com/nitoyon/as3query/as3QueryEvent.as

    r186 r196  
    1 package com.nitoyon.aquery { 
     1package com.nitoyon.as3query { 
    22import flash.utils.Dictionary; 
    33import flash.display.DisplayObject; 
     
    55import flash.events.Event; 
    66 
    7 internal class aQueryEvent { 
     7internal class as3QueryEvent { 
    88        static private var triggered:Boolean = false; 
    99 
     
    2222 
    2323                // Init the element's event structure 
    24                 var events:Object = aQuery.data(element, "events") || aQuery.data(element, "events", {}); 
     24                var events:Object = as3Query.data(element, "events") || as3Query.data(element, "events", {}); 
    2525                 
    2626                // Get the current list of functions bound to this event 
     
    3131                        handlers = events[type] = new Dictionary(); 
    3232 
    33                         var handle:Function = aQuery.data(element, "handle", function(... args):Object{ 
     33                        var handle:Function = as3Query.data(element, "handle", function(... args):Object{ 
    3434                                // returned undefined or false 
    3535                                var val:Object; 
    3636 
    3737                                // Handle the second event of a trigger 
    38                                 if ( aQueryEvent.triggered ) 
     38                                if ( as3QueryEvent.triggered ) 
    3939                                        return val; 
    4040                                 
    4141                                var event:Event = args.shift() as Event; 
    42                                 val = aQueryEvent.handle(element, event, args); 
     42                                val = as3QueryEvent.handle(element, event, args); 
    4343                                 
    4444                                return val; 
     
    6060        // Detach an event or set of events from an element 
    6161        static public function remove(element:IEventDispatcher, type:Object, handler:Function = null):void { 
    62                 var events:Object = aQuery.data(element, "events"), ret:Object, index:int; 
     62                var events:Object = as3Query.data(element, "events"), ret:Object, index:int; 
    6363 
    6464                if ( events ) { 
     
    9191                                if ( !ret ) { 
    9292                                        if (element) 
    93                                                 element.removeEventListener(typeStr, aQuery.data(element, "handle") as Function, false); 
     93                                                element.removeEventListener(typeStr, as3Query.data(element, "handle") as Function, false); 
    9494                                        ret = null; 
    9595                                        delete events[typeStr]; 
     
    100100                        for ( ret in events ) break; 
    101101                        if ( !ret ) { 
    102                                 aQuery.removeData( element, "events" ); 
    103                                 aQuery.removeData( element, "handle" ); 
     102                                as3Query.removeData( element, "events" ); 
     103                                as3Query.removeData( element, "handle" ); 
    104104                        } 
    105105                } 
     
    108108        static public function trigger(type:String, data:Array, element:IEventDispatcher, donative:Boolean = true, extra:Function = null):Object { 
    109109                // Clone the incoming data, if any 
    110                 data = aQuery.makeArray(data || []); 
     110                data = as3Query.makeArray(data || []); 
    111111                var val:Object; 
    112112 
     
    115115                        // Only trigger if we've ever bound an event for it 
    116116                        if ( global[type] ) 
    117                                 aQuery.create("*").add([aQuery.stage]).trigger(type, data); 
     117                                as3Query.create("*").add([as3Query.stage]).trigger(type, data); 
    118118 
    119119                // Handle triggering a single element 
     
    128128 
    129129                        // Trigger the event 
    130                         if ( aQuery.isFunction( aQuery.data(element, "handle") ) ) 
    131                                 val = (aQuery.data(element, "handle") as Function).apply( element, data ); 
     130                        if ( as3Query.isFunction( as3Query.data(element, "handle") ) ) 
     131                                val = (as3Query.data(element, "handle") as Function).apply( element, data ); 
    132132 
    133133                        // Extra functions don't get the custom event object 
     
    156156                var type:String = event.type; 
    157157 
    158                 var c:Dictionary = (aQuery.data(element, "events") && aQuery.data(element, "events")[type]) as Dictionary; 
     158                var c:Dictionary = (as3Query.data(element, "events") && as3Query.data(element, "events")[type]) as Dictionary; 
    159159                args.unshift( event ); 
    160160 
  • as3/as3Query/src/com/nitoyon/as3query/as3QueryFx.as

    r186 r196  
    1 package com.nitoyon.aquery { 
     1package com.nitoyon.as3query { 
    22 
    33import flash.display.DisplayObject; 
     
    55import flash.utils.clearInterval; 
    66 
    7 public class aQueryFx { 
     7public class as3QueryFx { 
    88        public var options:Object; 
    99        public var elem:DisplayObject; 
     
    1818 
    1919         
    20         public function aQueryFx(_elem:DisplayObject, _options:Object, _prop:String) { 
     20        public function as3QueryFx(_elem:DisplayObject, _options:Object, _prop:String) { 
    2121                options = _options; 
    2222                elem = _elem; 
     
    3333                        options.step.apply( elem, [ now, this ] ); 
    3434 
    35                 //(aQueryFx.step[prop] || aQueryFx.step._default)( this ); 
     35                //(as3QueryFx.step[prop] || as3QueryFx.step._default)( this ); 
    3636                elem[prop] = now; 
    3737 
     
    4747 
    4848                return 0; 
    49                 //var r = parseFloat(aQuery.curCSS(this.elem, this.prop, force)); 
    50                 //return r && r > -10000 ? r : parseFloat(aQuery.css(this.elem, this.prop)) || 0; 
     49                //var r = parseFloat(as3Query.curCSS(this.elem, this.prop, force)); 
     50                //return r && r > -10000 ? r : parseFloat(as3Query.css(this.elem, this.prop)) || 0; 
    5151        } 
    5252 
     
    6161                update(); 
    6262 
    63                 var self:aQueryFx = this; 
     63                var self:as3QueryFx = this; 
    6464                function t():Boolean { 
    6565                        return self.step(); 
    6666                } 
    6767 
    68                 aQuery.timers.push(t); 
     68                as3Query.timers.push(t); 
    6969 
    70                 if ( aQuery.timers.length == 1 ) { 
     70                if ( as3Query.timers.length == 1 ) { 
    7171                        var timer:uint = setInterval(function():void{ 
    72                                 var timers:Array = aQuery.timers; 
     72                                var timers:Array = as3Query.timers; 
    7373                                 
    7474                                for ( var i:int = 0; i < timers.length; i++ ) 
     
    8585        public function show(...args):void { 
    8686                // Remember where we started, so that we can go back to it later 
    87                 this.options.orig[this.prop] = aQuery.attr( this.elem, this.prop ); 
     87                this.options.orig[this.prop] = as3Query.attr( this.elem, this.prop ); 
    8888                this.options.show = true; 
    8989 
     
    9797                 
    9898                // Start by showing the element 
    99                 aQuery.create(elem).show(); 
     99                as3Query.create(elem).show(); 
    100100        } 
    101101 
     
    103103        public function hide(...args):void { 
    104104                // Remember where we started, so that we can go back to it later 
    105                 this.options.orig[this.prop] = aQuery.attr( this.elem, this.prop ); 
     105                this.options.orig[this.prop] = as3Query.attr( this.elem, this.prop ); 
    106106                this.options.hide = true; 
    107107 
     
    139139                                if ( this.options.hide || this.options.show ) 
    140140                                        for ( var p:String in this.options.curAnim ) 
    141                                                 aQuery.attr(this.elem, p, this.options.orig[p]); 
     141                                                as3Query.attr(this.elem, p, this.options.orig[p]); 
    142142                        } 
    143143 
    144144                        // If a callback was provided, execute it 
    145                         if ( done && aQuery.isFunction( this.options.complete ) ) 
     145                        if ( done && as3Query.isFunction( this.options.complete ) ) 
    146146                                // Execute the complete function 
    147147                                this.options.complete.apply( this.elem ); 
     
    153153 
    154154                        // Perform the easing function, defaults to swing 
    155                         this.pos = aQuery.easing[this.options.easing || (aQuery.easing.swing ? "swing" : "linear")](n, 0, 1, this.options.duration); 
     155                        this.pos = as3Query.easing[this.options.easing || (as3Query.easing.swing ? "swing" : "linear")](n, 0, 1, this.options.duration); 
    156156                        this.now = this.start + ((this.end - this.start) * this.pos); 
    157157