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 4033578
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:51:51+00:00 2026-05-20T11:51:51+00:00

I am using the following to rotate a textfield from its top right corner,

  • 0

I am using the following to rotate a textfield from its top right corner, I would like to know the best way to find the point of the top right corner.

           var txt:TextField = new TextField();
            txt.autoSize = TextFieldAutoSize.LEFT;
            txt.htmlText = "Some text here>";


            mtx = txt.transform.matrix.clone();
            MatrixTransformer.rotateAroundInternalPoint(mtx, txt.width, 0, -45);
            txt.transform.matrix = mtx;

EDITED:

I just written this test code below in the flash IDE (omg that hurts…), obviously there is an embedded font called Arial in the library. I can’t get the circle to correctly position on the top right of the textfield.

import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.geom.Matrix;
import flash.display.Shape;
import fl.motion.MatrixTransformer;
import flash.geom.Point;
import flash.text.TextFormat;
import flash.text.Font;

Font.registerFont(Arial);

var angle:Number = -45

var txt:TextField = new TextField();
txt.autoSize = TextFieldAutoSize.LEFT;
txt.embedFonts = true;
txt.defaultTextFormat = new TextFormat("Arial", 20, 0x0000ff);
txt.text = "Here is some text";
txt.border = true;
txt.x = 100;
txt.y = 100;
addChild(txt);

var circle:Shape = new Shape();
circle.graphics.beginFill(0x00ff00);
circle.graphics.drawCircle(-5, -5, 10);
circle.graphics.endFill();
addChild(circle);

var mtx:Matrix = txt.transform.matrix.clone();
MatrixTransformer.rotateAroundInternalPoint(mtx, txt.width, 0, angle);
txt.transform.matrix = mtx;

// The top right after being turned -45°
var localPoint:Point = new Point( txt.width, txt.height );
var globalPosition:Point = txt.localToGlobal( localPoint );

circle.x = globalPosition.x;
circle.y = globalPosition.y;
  • 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-20T11:51:52+00:00Added an answer on May 20, 2026 at 11:51 am

    If you mean what was the top right before turning it:

    // The field's original top right corner:
    var localPoint:Point = new Point( txt.width, 0 );
    var globalPosition:Point = txt.localToGlobal( localPoint );
    

    If you mean, after having turned the field:

    // The top right after being turned -45°
    var localPoint:Point = new Point( txt.width, txt.height );
    var globalPosition:Point = txt.localToGlobal( localPoint );
    

    EDIT:

    Ok, after seeing your test I experimented with a bunch of things and I think I found something that will work:

    var angle:Number = -45
    var txt:TextField = new TextField();
    txt.autoSize = TextFieldAutoSize.LEFT;
    txt.defaultTextFormat = new TextFormat("Arial", 20, 0x0000ff);
    txt.text = "Here is some text";
    txt.border = true;
    txt.x = 100;
    txt.y = 250;
    stage.addChild(txt);
    
    var local3d:Vector3D = new Vector3D( txt.width, txt.height );
    
    var circle:Shape = new Shape();
    circle.graphics.beginFill(0x00ff00);
    circle.graphics.drawCircle(-5, -5, 10);
    circle.graphics.endFill();
    stage.addChild(circle);
    
    var mtx:Matrix = txt.transform.matrix.clone();
    mtx.rotate( -45 / 180 * Math.PI );
    txt.transform.matrix = mtx;
    
    var globalPosition:Point = txt.local3DToGlobal( local3d );
    
    circle.x = globalPosition.x;
    circle.y = globalPosition.y;
    

    If I run this, I get a TextField, turned -45 degrees with a green ball stuck to what-used-to-be-the-bottom-right corner. I don’t know your MatrixTransformer class, but it should be able to work with any matrix.

    Try and copy&paste this code and fiddle around with it until you get the result you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following code to rotate an image http://www.platinumball.net/blog/2010/01/31/iphone-uiimage-rotation-and-scaling/ that's one of the
I am using the following code to rotate a image in ImageView by an
How do you rotate an image using jQuery-rotate plugin? I have tried the following
I using following code: var search = 'test'; if ($('#sku').find(search) ){ //alert(search); $(document).find(search).css('color','red'); <TABLE>
I am using following code to remove some specific nodes from xml file..It show
I am using the following code to rotate an uploaded jpeg image if the
I'm using the following code to rotate an image by an angle taking the
I'm using the following code to rotate images in opencv. However, afterwards the corners
I am using the following : $(#roottexts).tabs().tabs(rotate,5000, true); to let the tabs display their
I want to rotate image (left and right rotation) with angle 90.I am using

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.