Tuesday, January 15th, 2008
as3Query: jQuery port to ActionScript
First we see the new jQuery 1.2.2 release, and now "nitoyon" has ported jQuery to ActionScript 3.0 creating as3Query.
This port has everything bar the Ajax features, and it comes with a set of demos:
-
-
function animate(f:Boolean):void {
-
// Select 'RoundRect' elements using CSS selector
-
$("RoundRect:" + (f ? "odd" : "even"))
-
.addTween({
-
rotation: 90,
-
scaleX: 0.5,
-
scaleY: 0.5,
-
time: 0.6,
-
delay: 0.3,
-
transition: "easeOutCubic"
-
})
-
.addTween({
-
scaleX: 1,
-
scaleY: 1,
-
time: 0.5,
-
delay: 0.9,
-
transition: "easeOutElastic",
-
onComplete: function():void {
-
// restore the rotation and call again.
-
this.rotation = 0;
-
animate(!f);
-
}
-
});
-
}
-













I did a very similar thing lat year ago:
http://ioreader.com/2006/08/25/jquery-inspired-actionscript-library/
http://ioreader.com/2006/08/29/jquery-inspired-actionscript-library-part-2/
Where flash is concerned, it’s worth delving into class oriented programming… I use prototype and jQuery or own written mini libs in all my xhtml projects, but more out of nescessity then choice. I used to do the same in flash, till I discovered the power of classes. That said, I must say libraries like these can be quite a boon for quick and dirty projects, for big long term projects, use classes, you’ll do yourself (and possibly other parties that will maintain the project) a big favour.