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

Element coordinates for Responsive design are incorrect

Explorer ,
Jun 10, 2019 Jun 10, 2019

I have started using Animate CC with the 'responsive' design features.
I have the 'Make Responsive' publishing feature turned on and set to 'Both'.

I have some code to drag an instance of a symbol around the stage, but I have noticed that when the movie is scaled in the browser the read x and y coordinates for the instance do not scale with the change in canvas size.

The elements themselves move and scale as appropriate but the read coordinates return the non-scaled values.

As an example...

var Sym = this.SymInst;

Say the project is unscaled in the browser and the following X values are returned:


stage.mouseX = 242

Sym.x = 449

Now scale the project in the browser to a smaller size and position mouse in the same relative position:

stage.mouseX = 86

Sym.x = 449

So the mouse coordinate is changing appropriately.

But the element coordinate isn't.

How do I get the scaled coordinates for the element?

279
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 , Jun 10, 2019 Jun 10, 2019

Animate doesn't have any responsive design features. It just has the same stage scaling that's existed in Flash since forever, which the publish settings incorrectly calls responsive. Adobe's marketing department is probably behind this particular bit of deceptive labeling.

Anyway, to get corrected coordinates, just multiply (or divide, depending on what you're doing) your raw coordinates by stage.scaleX and stage.scaleY.

You're generally better off adjusting the mouse coordinates instead of the c

...
Translate
LEGEND ,
Jun 10, 2019 Jun 10, 2019

Animate doesn't have any responsive design features. It just has the same stage scaling that's existed in Flash since forever, which the publish settings incorrectly calls responsive. Adobe's marketing department is probably behind this particular bit of deceptive labeling.

Anyway, to get corrected coordinates, just multiply (or divide, depending on what you're doing) your raw coordinates by stage.scaleX and stage.scaleY.

You're generally better off adjusting the mouse coordinates instead of the coordinates of literally everything else.

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
Explorer ,
Jun 10, 2019 Jun 10, 2019
LATEST

Thanks ClayUUID

Just what I needed to know.

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