Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4346098
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:07:42+00:00 2026-05-21T12:07:42+00:00

Normally, to center an instance on the stage to another vertically horizontally, you can

  • 0

Normally, to center an instance on the stage to another vertically horizontally, you can use simple logic and by referencing width, height, x and y co-ordinates of the symbols involved.

This seems impossible in-situ, because Textfield.height and Textfield.textHeight report incorrect values. They bring back the same values, which don’t reflect the actual height of the instance on the stage.

enter image description here

I have crafted this simple example to illustrate the problem: http://omnom.replete.nu/fails.fla

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T12:07:42+00:00Added an answer on May 21, 2026 at 12:07 pm

    The height of the TextField does not relate to the Height of the text itself.
    Text height can change for a number of reasons.
    A good example would be the font family and font sizes.
    You need to use text metrics to get that info.
    ALL THE INFO HERE

    [EDIT]
    per your comments the last line of your scaleTextToFitInTextField function should do this.
    you need to find the center of both objects and subtract them then add the offset

    txt.x = cont.width/2 - txt.width/2 + cont.x
    txt.y = cont.height/2 - txt.height/2 + cont.y
    

    [EDIT EDIT]
    Also remove these 2 lines as they are now redundant

    red.tf.x = red.mchammer.x;
    red.tf.y = red.mchammer.y;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Normally I use imagecreatefromjpeg() and then getimagesize() , but with Firefox 3 I need
Normally you can do this: <select size=3> <option>blah</option> <option>blah</option> <option>blah</option> </select> And it would
Normally I create web application projects and use code-behind, but I have a requirement
Normally, you center images with display: block; margin: auto , but if the image
I normally use CSS rules for margin:0 auto along with a 960 container for
I have this CSS code: #tweet-container{ width: 290px; height: 272px; border: 1px solid #CCC;
I have an oveflowing table and I cannot center the heading following the width
On this page , I would like to horizontally center the main #container div
The call center managers for my company use document libraries in a SharePoint 2007
I have user control with a gridview, but for some reason I can't use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.