A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 33

Thread: Tweens, How are they in 3.0?

  1. #1
    Senior Member
    Join Date
    Aug 2001
    Posts
    227

    Question Tweens, How are they in 3.0?

    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?

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    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:

    http://livedocs.macromedia.com/labs/as3preview/langref/
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Senior Member
    Join Date
    Aug 2001
    Posts
    227
    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.
    Last edited by Zeusbwr; 09-04-2006 at 04:40 PM.

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    As I said they are part of Flex 2 under mx.effects.Tween but currently not available for the Flash9 preview.
    You can check by yourself here

    http://livedocs.macromedia.com/flex/...ref/index.html


    Ckeck the class Timer under flash.utils which is equivalent to setInterval.
    Last edited by cancerinform; 09-04-2006 at 06:59 PM.
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Senior Member
    Join Date
    Aug 2001
    Posts
    227
    Yea but that is part of flex, not flash correct? And i don't have flex.. Sorry if i am missing a huge point you are making lol :/

  6. #6
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    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. -

  7. #7
    Senior Member
    Join Date
    Aug 2001
    Posts
    227
    ok kool. I'll check out a timer class or i'll use enterframe on a background class to manage time.

    Dunno which will be faster though.. timers are usually excessively hogging though. (just in general, no idea about flash)

  8. #8
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Here is an example made with the timer class. I can't give it out because it is commercial. Click on links. I guess this is what you are looking for?

    http://flashscript.biz/book/final/as...menubar_2.html

    If you have specific questions start a new thread
    - The right of the People to create Flash movies shall not be infringed. -

  9. #9
    Senior Member
    Join Date
    Aug 2001
    Posts
    227
    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)

  10. #10
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    The buttons are moving down (y)
    - The right of the People to create Flash movies shall not be infringed. -

  11. #11
    Senior Member
    Join Date
    Aug 2001
    Posts
    227
    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.

  12. #12
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    I quickly prepared a little example to get you started, but check the class there are many more options.
    Attached Files Attached Files
    - The right of the People to create Flash movies shall not be infringed. -

  13. #13
    Senior Member
    Join Date
    Aug 2001
    Posts
    227
    cool, i'll check it out when i get home from work tonight. Thanks!

  14. #14
    Member
    Join Date
    Sep 2006
    Posts
    43
    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.

  15. #15
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    The example for download contains easing .
    - The right of the People to create Flash movies shall not be infringed. -

  16. #16
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,358
    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.

  17. #17
    Member
    Join Date
    Sep 2006
    Posts
    43
    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]

  18. #18
    \x3a\x6f\x29
    Join Date
    Sep 2005
    Location
    paris
    Posts
    88
    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).

  19. #19
    Member
    Join Date
    Sep 2006
    Posts
    43
    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.

  20. #20
    Senior Member
    Join Date
    Aug 2001
    Posts
    227
    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?
    Last edited by Zeusbwr; 09-07-2006 at 01:35 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center