A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Tween Actionscript question

  1. #1
    Member
    Join Date
    Jul 2003
    Posts
    80

    Tween Actionscript question

    Hi everyone,

    I pretty much want to make a MC move when i press a button.
    Right now, my code moves it from one beginning location to an ending location. I would like it to always begin whereever it is, instead of 1, and end at x=300. So when i click the button, my mover clip moves to x:300.

    Heres my code:
    PHP Code:
    _root.butt.onRelease = function () {
      
    tweenBall();
    };
    function 
    tweenBall() {
      
    easeType mx.transitions.easing.Regular.easeInOut;
      var 
    begin 1;
      var 
    end 300;
      var 
    time .4;
      var 
    mc mover;
      
    ballTween = new mx.transitions.Tween(mc"_x"easeTypebeginendtimetrue);

    Any help would be great!
    Last edited by kingkelly; 04-04-2009 at 09:45 PM.

  2. #2
    Member
    Join Date
    Mar 2009
    Location
    Brooklyn, NY
    Posts
    77
    Try changing:
    Code:
    var begin = 1;
    to:
    Code:
    var begin = mover._x;
    Break it until it works.

  3. #3
    Member
    Join Date
    Jul 2003
    Posts
    80
    Yes yes, thank you kind sir

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