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

Animate cc html5 find original canvas height and width

Explorer ,
Apr 15, 2021 Apr 15, 2021

Copy link to clipboard

Copied

I'm looking for a way to get the canvas width and height after having opened the page and posibly resized the page.

 

My publish settings have to be on responsive but I need to get the widht and height my canvas was when it was drawn. If I after opening the page and resizing it simply get the width/height of the canvas by looking at it's current state this won't give me the initial values of width and height but it will return the current height and width.

 

I need to know the width and height it is when its not resized when it's currently resized to place an object on the mouse location after click and for this i need to calculate the ratio between the original size of the canvas and the current size. I can't add the width and the height of my drawing to my script because the width and height can be different and i would like to not have to edit the script each time.

TOPICS
Code

Views

411

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

correct answers 1 Correct answer

Community Expert , Apr 15, 2021 Apr 15, 2021

Hi.

 

Use:

 

lib.properties.width;
lib.properties.height;

 

 

The essential document properties defined in the FLA are stored in this global var called lib that is created in the publishing process.

 

Regards,

JC

Votes

Translate

Translate
Community Expert ,
Apr 15, 2021 Apr 15, 2021

Copy link to clipboard

Copied

LATEST

Hi.

 

Use:

 

lib.properties.width;
lib.properties.height;

 

 

The essential document properties defined in the FLA are stored in this global var called lib that is created in the publishing process.

 

Regards,

JC

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