A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Using Algebraic Equation in Flash

  1. #1
    Senior Member
    Join Date
    Jul 2007
    Posts
    243

    Using Algebraic Equation in Flash

    ok i'll describe this as simple as i can.
    in AS3 i have a start value of x = 0 and an end value of x = 400 with a tween to get it from start to finish by using x += 400.
    however if you double click the button which triggers the function on the 2nd click it takes that x position and adds 400 onto it so everything goes out of sync.
    i am now trying to make the end value always equal to the appropriate place it should be ie if x = 250 it should only add on 150 and if x = 450 it should = 800.
    can anybody offer me an equation to help me as i can't think of it.
    thanks
    Dan

  2. #2
    Senior Member
    Join Date
    May 2006
    Location
    Manhattan
    Posts
    246
    400 - x gives you the amount to tween- most tweening packages offer relative (this scenario) and absolute coordinates; it might be possible to explicitly set 400 as your target.

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