Skip to main content
pauldbabs
Inspiring
June 10, 2019
Answered

Element coordinates for Responsive design are incorrect

  • June 10, 2019
  • 1 reply
  • 337 views

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?

This topic has been closed for replies.
Correct answer ClayUUID

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.

1 reply

ClayUUIDCorrect answer
Legend
June 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.

pauldbabs
pauldbabsAuthor
Inspiring
June 10, 2019

Thanks ClayUUID

Just what I needed to know.