I am a giant fan of The Custom MC Tween Classes, so much so, that i'll have a hell of a time living without them.
Does 3.0 handle tweening any better than 2.0? I'm not good in complicated math so setting up my own tween falloffs and junk would be hell.. Any comments?
The Tween classes are part of Flex 2 and did not come wuth AS3 preview. May be the final version will contain these classes. You need to create your own tweens for the moment. These are the classes, which came with the preview:
Crap. Any tutorials or examples of how to do this?
I don't need anything extravagant, but i'm sure the math i would use to frame by frame move my objects, would be slow to say the least.. Not to mention no falloffs.. hmm.
If i remember right, those tween functions offered a set of functions for you to use (it would let you export a falloff basically) which i might be able to use in 3.0.
*edit*
After examening Robert Penner's calculations it looks as if i could do this quiet easily. I would have to learn quite a bit on how they work, but its all open math so it is easily possible.. to those with the brains lol.
Once i can get classes better declared i can start implemnting a 3.0 version.
I assume prototypes would still be the best method of doing this? Or are they even in 3.0.. hmm time to look stuff up lol.
All the examples I have seen before Flex 2 came officially out have been created with Eclipse using the Flex framework. I don't know of any recent tween examples using the AS3 preview. Use the Timer class.
- The right of the People to create Flash movies shall not be infringed. -
Well the rollover graphic change is fading in and out, so yes that is what i am looking for. But is it efficient enough to do on a larger smoother scale?
And what are you doing, just setting a timer to trigger a function which then changes the alpha of some movieclip? (or some value, alpha for example)
Ah ok, didn't notice those (i wasn't pressing those two aparently lol)
But thats besides the point, thats all from timers? I'll have to give it a try then, see how effective it is alongside falloff curves.
LOVING 3.0 btw. Got a lot of little things to get used to be immedietly it is making more sense than 2.0 ever did.. though that is just due to my C++ & C# background.
Rewriting a tweening class from scratch is daft. You'll need more than just a timer. What about easing functions? I suppose you could use Robert Penner's...
It would be much simpler to just download the Flex 2 SDK (free) - I'm pretty sure the Tweening classes are part of it. Look for the mx folder and copy it into your Flash 9 class path. I've not tried them but they really should work - you'll probably need the whole mx folder - not just the effects folder or the tweening classes.
The tweening classes in the mx framework of Flex 2 are a bit messy and rely on a lot of other aspects of mx (less encapsulated than those used in Flash 8 etc). However, devonair said he got them to work in Flash 9 but he said "I had to comment out the includes and delete all references to the mx_internal namespace." So you might need to fiddle with them a bit to get them to work.
Otherwise you can rely on other alternatives such as cancerinform's.
Aren't namespaces supposed to avoid that sort of thing? I'm guessing there will still be a an "mx" namespace in Flash 9 - it's been there since v.7 (or was it 6?). So we'll have an "mx" namespace in Flash and a different one in Flex!?! Shouldn't Macdobe have assigned them different identifiers? In fact why use the "mx" namespace at all in Flex? After all they're not even using the "flex" namespace. [Slaps forehead]
There is a difference between a package and a namespace. You are talking about packages if I get you right. But we should not mix theese things since namespaces are now also implemented (even if they are not as nice as C++'s namespaces).
Yeah yeah my bad - doesn't invalidate my point though - The point of packages and namespaces is to keep identifiers unique and having one mx for Flash and a different mx Flex is asking for trouble.
So i got time tonight (and after going through more tutorials so i have a better grasp of events, the display list, etc), and i see your example is very simple.
I noticed that you still use a timer, but this is just one object. If you wanted to move say 10 objects independantly, would it be best to create 10 timers or one big timer that runs everything.. and in which the objects look to?
*edit*
I'm kind of busy at the moment, but perhaps i can find the source of some of the other easing classes that use robert pennings equations and see how they do it. They are all frame rate independant, and are prototyped right into the movieclip class...
On a sidenote, Is prototyping (the act of adding functions to a different class.. assuming i understand it right) still possible in AS3?