A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: a simple scripted motion tween question

Hybrid View

  1. #1
    user in A minor
    Join Date
    Jan 2005
    Location
    finland
    Posts
    121

    a simple scripted motion tween question

    hi u all!
    i found a nice tut about tweening with action scripting, and actually can make some sense of it. hooray! it works. but how could i alter the code so that i can make my object (here figure1_mc) move diagonally instead of straight horizontal/vertical line? the tut explains only how to toggle x or y values separately. ok ok, my cover has blown: i'm pretty new to action scripting, but i'm learning...

    here's the code:

    var easeType = mx.transitions.easing.Regular.easeOut;
    myTween = new mx.transitions.Tween(figure1_mc, "_y", easeType, 0, 300, 30);

    so if there's anyone with extra hands out there, i sure could use one now
    manymanythnx, mar

  2. #2
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    if you do a _x tween and a _y tween then you get a diagonal tween.

    Code:
    var easeType = mx.transitions.easing.Regular.easeOut;
    myTweenx = new mx.transitions.Tween(figure1_mc, "_x", easeType, 0, 300, 30);
    myTweeny = new mx.transitions.Tween(figure1_mc, "_y", easeType, 0, 300, 30);
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  3. #3
    user in A minor
    Join Date
    Jan 2005
    Location
    finland
    Posts
    121
    i actually tried that earlier, but it wouldn't work for me - now, double-checking i found a mistake in instance names. how typical is that. blind as a bat, me...
    thanks, this helps a lot!
    mar

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