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

AS3 horizontal rotation- how to?

Community Beginner ,
Jan 13, 2010 Jan 13, 2010

Hello:

I have this movie clip on stage (dsp), which I would like to keep rotating horizontally. With the following script it rotates in circular mode from left to right, but not horizontally (left to right or vice versa). How do I rotate it horizontally?

dsp.addEventListener(Event.ENTER_FRAME, rotateHorizontal);
function rotateHorizontal(event:Event): void
{
dsp.rotation += 0.5;

}

Thanks in advance

German

TOPICS
ActionScript
1.4K
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

Community Expert , Jan 14, 2010 Jan 14, 2010

then you probably want to use the rotationY property.  there are also rotationX and rotationZ properties you should check.

Translate
Community Expert ,
Jan 13, 2010 Jan 13, 2010

are you using flash cs4 and publishing for fp 10?

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
Community Beginner ,
Jan 14, 2010 Jan 14, 2010

Kglad:

Yes, I'm using CS4 and publishing for flash player 10.

German

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
Community Expert ,
Jan 14, 2010 Jan 14, 2010

then you probably want to use the rotationY property.  there are also rotationX and rotationZ properties you should check.

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
Community Beginner ,
Jan 14, 2010 Jan 14, 2010

Kglad:

Thanks! It's I what needed. To rotate right to left I used + speed and - speed for right to left, The final script is as follows:

var speed:int = 2;


dsp.addEventListener("enterFrame", rotateHorizontal);

function rotateHorizontal (event:Event):void {
dsp.rotationY -= speed;   
}

Thanks again.

German

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
Community Expert ,
Jan 14, 2010 Jan 14, 2010
LATEST

you're welcome.

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