PDA

View Full Version : asapLibrary


JLM
04-24-2009, 01:34 PM
An AS3 to haxe port question

I have been using
http://asaplibrary.org/
in flash for queueing or sequencing tweens, there are other possibles such as 'go' but I am unsure on how to use it this way.

For filter effect tweening of pv3d I have been using tweenlite within an asaplibrary tween queue. Although it may all be possible with a single engine I only have so much time to read manuals!

There are a couple of tween engines in haXe but I am not sure any provide sequencing of groups of tweens/function calls or if they tint or blur, I believe list (modifed version) may make a good structure for sequences but I am not sure which of the current haXe tween libraries would be easiest to mod for this end, and would also provide speed.

greensock
04-25-2009, 05:06 AM
This may not be helpful at all (I'm not a haXe guy), but managing/creating sequences and groups of TweenLite/Max tweens is about to get a lot more intuitive and flexible in v11 of the GreenSock platform. Check out the TimelineLite and TimelineMax classes. Think of them like ActionScript versions of a MovieClip timeline. You can insert(), append(), and prepend() tweens anywhere on the a timeline instance, then gotoAndPlay(), gotoAndStop(), play(), stop(), reverse(), restart(), skip to any point on the timeline with the "progress" or "time" properties, alter the timeScale, nest timelines within timelines, repeat them, yoyo, etc. See http://blog.greensock.com/v11beta/. It's technically in beta right now, but the AS3 code is available for anyone to download.

evride
04-25-2009, 05:58 AM
greensock, do you have something set up like an RSS feed that checks popular AS3 forums for the word Tween so that you can discuss your TweenLite project? Or do you just search everyday? I'm not hating (I actually really like TweenLite), I just think it's odd that you pop up outta the blue to answer questions only relating to tweening in AS3.

greensock
04-25-2009, 06:24 AM
LOL. No, I don't have an RSS feed, but my blog tells me where traffic is coming from, so when I see something from a place like actionscript.org (and I have time), I'll check it out. While I'm there, I'll often do a quick search because I want to make sure my user base is getting the support they need. I stay pretty focused on the tween-related posts because I have limited time, that's all.

asf8
04-25-2009, 03:17 PM
I have often wondered this also, you do a pretty good job responding all over the internet (forums, blog posts, etc.. I see you everwhere). Keep up the great work!

JLM
04-26-2009, 11:21 PM
Thanks Greensocks.

There seems to be atleast three solutions to the queue aspect (probably more!!)

asapLibrary http://asaplibrary.org/
goAsap http://www.goasap.org/
TweenLite/Max http://blog.greensock.com/v11beta/

Ideally anything ported needs to go into haxeLib.. I am not sure if any conform to haxeLib licence spec?

"GPL, LGPL, BSD, Public (for Public Domain)"

Anyone an expert in licenses know, I have not bench marked or looked at real usability differences, greensock have you done any tests of your beta against these other architectures or have any comments?

TweenLite does seem to be a good solution
http://www.remixtechnology.com/view/flex3_tweenlite_vs_tweenerhx_demo

greensock
04-27-2009, 06:18 AM
greensock have you done any tests of your beta against these other architectures or have any comments?

TweenLite does seem to be a good solution
http://www.remixtechnology.com/view/flex3_tweenlite_vs_tweenerhx_demo

I'm not aware of any popular tweening engine that's as fast as TweenLite. Some tests out on the internet use old/stale versions of TweenLite that weren't as fast as the current one. The test at remixtechnology.com is a little tricky to figure out (I couldn't find any source code for it and some of the behavior looked fishy). I have tested HydroTween (a GoASAP-based engine) and it was significantly slower than TweenLite under heavy loads. I just plugged the new v11 TweenLite (http://blog.greensock.com/v11beta/) into Moses' TweenBencher and it looks like it beats all the other engines including the simple WidthTween (by a pretty wide margin too).

I'd encourage everyone to do their own speed tests or at least download the source code from the benchmarks online to make sure things are fair-and-square. I've seen some tests that are extremely deceptive and stacked in the author's favor (not Moses'). If the author doesn't offer the source code of the test, I wouldn't give it much credibility.

Here are some benchmarks I've put together that are intended to test "real world" usage of the engines: http://blog.greensock.com/tweening-speed-test/ (the link to the source code is towards the top).

As for the licensing issue, TweenLite isn't MIT or any other "standard" open source license. However, it is completely free for virtually all uses including commercial uses with one minor exception which you can read about at http://blog.greensock.com/licensing/. Its licensing model helps protect it from the common frailties of open source projects which often wither and die as the authors get busy with other more profitable endeavors, gradually resenting support requests from their once exciting venture. So if haXe requires one of the standard open source licenses, then maybe TweenLite wouldn't be a good fit but I firmly believe that TweenLite's licensing model serves the community best when all things are considered.

The original post asked about setting up sequences and groups. I think you'll find that TimelineLite and TimelineMax (http://blog.greensock.com/v11beta/) provide an intuitive solution that is very robust and flexible (skip around anywhere, reverse(), nest timelines, adjust timeScale, etc.). Plus they leverage the speed and feature set of TweenLite/Max which you're already comfortable with so it seems like a pretty ideal solution.

I'd also encourage developers to try using the various options out there and see how they compare. Frankly, many of the engines/frameworks are surprisingly difficult to use. They get cumbersome and verbose quickly. Of course I'm biased, but I hear from users all the time who say that one of the "features" they love most about the GreenSock platform is the fact that it's so easy to use and intuitive, yet not lacking in power/flexibility. That's a subjective thing, though, which is why I'd encourage folks to try working with the various options and decide for themselves which "feels" best.

Happy tweening!