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

Interactive rotate object to follow movement of mouse

Community Beginner ,
May 12, 2020 May 12, 2020

How can I create this rotation (following mouse movement) on an image, in Animate? http://jsfiddle.net/opherv/ddGHz/

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
Community Expert ,
May 12, 2020 May 12, 2020
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 ,
May 12, 2020 May 12, 2020

It was a start. I need to rotate an image file the same way.

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 ,
May 13, 2020 May 13, 2020

Hi again.

 

Place the image inside of a Movie Clip instance.

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 ,
May 22, 2020 May 22, 2020
LATEST

Here is the exact example of what I want, but it seems that I'm missing something.

 

I finally got it 🙂 such a RELIEF 🙂

 

stage.enableMouseOver(30);
var _this = this;
stage.on('stagemousemove', function(e){
var radians = Math.atan2(e.localY - _this.movieClip_1.y, e.localX - _this.movieClip_1.x);
var degrees = radians*(180 / Math.PI);
_this.movieClip_1.rotation = degrees - 90;
});

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