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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:13:08+00:00 2026-05-31T21:13:08+00:00

We want to scale, rotate and drag functionality in flash as3. I do have

  • 0

We want to scale, rotate and drag functionality in flash as3.
I do have some code. It’s rotation functionality is working good. But After we rotate image, zooming functionality does not work.

we rotate, and zoom image by one reference point.

Here is code:

function scaleRotateFromPoint(sx:Number, sy:Number, ptCenter:Point, angle:Number):void{
    var mat:Matrix = imgMat.clone();
    mat.tx -= ptCenter.x;
    mat.ty -= ptCenter.y;
    mat.rotate (angle*(Math.PI/180));
    mat.scale(sx,sx);
    mat.tx += ptCenter.x;
    mat.ty += ptCenter.y;
    loaderFirst.transform.matrix = mat;
}   

we need to pass one point, zoom value and rotation angle.

Thanks in advance.

  • 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-31T21:13:09+00:00Added an answer on May 31, 2026 at 9:13 pm

    I’ve just had a play with your function in Flash, and it seems to work perfectly for me.

    I changed the code so that it took the transform object as a parameter, and set the modified matrix after modifying it to make absolutely sure it was being used correctly.

    function scaleRotateFromPoint(t:Transform, sx:Number, sy:Number, ptCenter:Point, angle:Number):void {
        var mat:Matrix = t.matrix;
        mat.tx -= ptCenter.x;
        mat.ty -= ptCenter.y;
        mat.rotate (angle*(Math.PI/180));
        mat.scale(sx,sy);
        mat.tx += ptCenter.x;
        mat.ty += ptCenter.y;
        t.matrix = mat;
    }
    // usage:
    scaleRotateFromPoint(clip.transform, 1.01, 1.01, new Point(277,185), 5 );
    

    The apparent problem might be because you’re specifying the center point in the DisplayObject‘s local co-ordinates. The center point is specified in the parent co-ordinate space.

    If you need to specify the co-ords in local space, one straightforward way to convert between co-ordinate spaces by using the DisplayObject.localToGlobal() and globalToLocal() functions. (Alternatively, you can invert() the local matrix, and transformPoint() to get a point in the parent‘s space.)

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

Sidebar

Related Questions

I have a several views that I can drag around, rotate, scale. I want
I want to have in my GUI capability for scale, rotate and crop images
I want to scale an image in C# with quality level as good as
Say I have a BitmapData of 600x600 and I want to scale it down
I have one small online sale business but I want to make it scalable
I want to scale images to fit with in some predefined size without affecting
I have a set of AI files that I want to scale up. The
suppose I have selected image from image picker,and now I want to scale that
I am working on some touch events and gestures, I want to be able
I want to scale images these day and find the following example: Example #1

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.