Results 1 to 2 of 2

Thread: [Flash] Rotating an object to point to the centre.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2007
    Posts
    146

    [Flash] Rotating an object to point to the centre.

    Anybody know of a tutorial in Flash Pro 8 that helps me to rotate an object to point to the centre.

    If not please could somebody direct me to a flash forum?
    [email protected]

    Currently Using:
    Microsoft Visual Basic 2008 Expess Edition
    Windows Vista Home Basic
    1280 x 1024

    Rank:
    Novice


  2. #2
    Member
    Join Date
    Feb 2008
    Location
    Darwin, Australia
    Posts
    42

    Re: [Flash] Rotating an object to point to the centre.

    Here's some code:
    Code:
    onClipEvent (enterFrame) {
    	GotoX = Stage.width/2;
    	GotoY = Stage.height/2;
    	DifferenceX = _x-GotoX;
    	DifferenceY = _y-GotoY;
    	_rotation = -Math.atan2(DifferenceX, DifferenceY)/(Math.PI/180);
    }
    I hope it helps.

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