Copy link to clipboard
Copied
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?
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
...Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thanks ClayUUID
Just what I needed to know.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now