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

X/Y positions match the stage in actionscript, but not in javascript

New Here ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

Hi there,

I've made the switch from AS3 to javascript. I'm having a problem coding the positions of movieclip symbols. In AS3 I could drag a symbol on the stage, note its positiona and tween it in code. In javascript the x y positions do not correlate to what I'm seeing on my stage.

Here's an example tweening a symbol called economy.  

 

TweenMax.to(that.economy, 4, {y:150, ease:Sine.easeInOut, delay:0.5});

 

The stage is telling me that position I seek is y:393, but to get it to move to that position in code I have to ask it to go to y:150. Is there a  way to get the code position and the stage position to line up?

Many thanks

Adam 

TweenMax.to(that.economy, 4, {y:150, ease:Sine.easeInOut, delay:0.5});

TOPICS
Code , How to , Product issue

Views

135

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 ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

I've seen similar things when testing on a retina display - that the case here? You basically have to test for screen depth and then adjust all measurements: window.devicePixelRatio

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
LEGEND ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

LATEST

First, you're probably noting the registration point instead of the centerpoint.

 

Second, why are you using TweenMax instead of the built-in tween library?

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