Skip to main content
Known Participant
December 19, 2021
Answered

Find a dynamic text box's height with Javascript

  • December 19, 2021
  • 1 reply
  • 430 views
Hey all Pretty sure this is not doable but trying anyways: I'm looking to read with Javascript the height of a text box as set inside Animate. Meaning - I have set a text box in Animate which is higher than the text that it holds. I would like to read the height of the box. For a given instance, named lets say "message", then this.message..getBounds().height, this.message..getMeasuredHeight(), etc... all return the height of the actual text, not the height of the box holding that text. Does anyone have an idea how to get the box's height? Thnx in advance!
    This topic has been closed for replies.
    Correct answer JoãoCésar17023019

    Hi.

     

    As far as I can tell, that bounding box is only used in the author time. That information is not retained in the output.

     

    Perhaps a workaround would be to adjust your text box to have a height that is the multiple of a line of text. So you can get the height of one single line of text and multiply it by 2, 3, 4 and so on.

     

    Regards,

    JC

    1 reply

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    December 19, 2021

    Hi.

     

    As far as I can tell, that bounding box is only used in the author time. That information is not retained in the output.

     

    Perhaps a workaround would be to adjust your text box to have a height that is the multiple of a line of text. So you can get the height of one single line of text and multiply it by 2, 3, 4 and so on.

     

    Regards,

    JC