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

Interactive rotate object to follow movement of mouse

Community Beginner ,
May 12, 2020 May 12, 2020

Copy link to clipboard

Copied

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

Views

1.1K

Translate

Translate

Report

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

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Hi again.

 

Place the image inside of a Movie Clip instance.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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;
});

Votes

Translate

Translate

Report

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