Skip navigation
Currently Being Moderated

Random problem

May 7, 2012 3:22 PM

Hi

 

My ball turns just once and stops where it began after one circle.Meaning 360 degrees; what if I want it to stop at 275, or 160. Help, suggestions,  will be appreciated. Thank you. I can make it turn as many times I want to, but the ball always end up at the origin of mouvement. Timer ???  And Randomize it ?

 
Replies
  • Currently Being Moderated
    May 7, 2012 3:56 PM   in reply to Samsimms

    not enuff info.

     

    how are you making it turn just once? and by turn, do you mean rotate (like the hands of a clock)?

     
    |
    Mark as:
  • Currently Being Moderated
    May 7, 2012 4:20 PM   in reply to Samsimms

    how does the ball rotate? timeline tween or code?

     
    |
    Mark as:
  • Currently Being Moderated
    May 7, 2012 5:09 PM   in reply to Samsimms

    var newRotation:Number;

    var myTween:Tween

     

    myButton.addEventListener(MouseEvent.CLICK, onClick);
    function onClick(e:MouseEvent){

        newRotation = Math.random() * 360;
       myTween = new Tween(myBall, "rotation", Strong.easeOut, myBall.rotation, newRotation, .5, true);
    }

     
    |
    Mark as:
  • Currently Being Moderated
    May 7, 2012 10:46 PM   in reply to Samsimms

    i thought you would know to have this up at the top of your code if you didnt already:

     

    import fl.transitions.Tween;
    import fl.transitions.easing.*;

     
    |
    Mark as:
  • Currently Being Moderated
    May 8, 2012 10:53 AM   in reply to Samsimms

    i cant help unless you show your code and explain the setup. without that we can only guess

     

    whats the code for your button?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points