Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Set variables as zero
  2. fMov = 0;
  3. aDrag = 0;
  4. gDrag = 0;
  5. totalF = 0
  6.  
  7. function moveStuff() {
  8.     //Get values from text fields
  9. fMov = fmov.text;
  10. aDrag = adrag.text;
  11.        
  12. // Calculate total force
  13. totalF = fMov - ( aDrag + gDrag );
  14. // Show total force
  15. totalf.text = totalF;
  16. if ( totalF > 0 )
  17. {
  18. // if total force is greater than zero, rotate rectangle
  19. rect._rotation += totalF;
  20. }
  21. }
  22. rect.onEnterFrame = moveStuff;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement