Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Rotating Object Counterclockwise/Clockwise

Contributor ,
Feb 02, 2013 Feb 02, 2013

Hi,

I'm not able to use tweening for rotation in a project because when exported for AIR Android, tween gets stuck or runs too slowly on the tablet device. (I also prefer not to use a tween plugin, if possible.)

Instead, I can use rotation, and it works very well on the device.

For example,

if (rotateT){

object.rotation += 5;

}

//coupled with

rotateT= true;

                            if (targetRotation < 180) {

                                targetRotation = object.rotation + 90;

                            }

                            else {

                                targetRotation = -targetRotation + 90;

                            }

                        }

This works well for clockwise rotation.

But, I need some help figuring out how to create a counterclockwise rotation using the same type scripting, if this is possible.

Any help appreciated.

TOPICS
ActionScript
5.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Feb 02, 2013 Feb 02, 2013

Just subtract the rotation increment instead of adding it to rotate in the opposite direction.

Translate
LEGEND ,
Feb 02, 2013 Feb 02, 2013

Just subtract the rotation increment instead of adding it to rotate in the opposite direction.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 02, 2013 Feb 02, 2013
LATEST

Thank you, Ned.

I'll give it a try.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines