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

  • Home
  • SEARCH
  • 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 8023065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:27:28+00:00 2026-06-04T22:27:28+00:00

I have a bitmap in AS3 flash and I am sending it over to

  • 0

I have a bitmap in AS3 flash and I am sending it over to javascript using a base64 encoded jpg string.

All that works great. I need to send the img over scaled down, and rotated 180deg. The scaling works, but not the rotation. The rotation never takes. I know Im am obviously doing it wrong, but don’t know the right way.

So basically I just need to rotate the image 180deg so when it is sent to javascript it is upside down.

Here is my transform code

var scaleFactor:int = 5;

var tempBitmap:BitmapData = new BitmapData(img.width/scaleFactor, img.height/scaleFactor);
var drawMatrix:Matrix = new Matrix(1/scaleFactor, 0, 0, 1 /scaleFactor );
drawMatrix.rotate(Math.PI); //180deg

tempBitmap.draw(img, drawMatrix);
  • 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-06-04T22:27:29+00:00Added an answer on June 4, 2026 at 10:27 pm

    I think you need to translate your object after rotation otherwise it gets clipped so you don’t see it, I did an example with a bitmap in a MovieClip just on the stage using CS5.

    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.display.MovieClip;
    
    var scaleFactor:int = 1;
    
    var tempBitmap:BitmapData = new BitmapData(img.width, img.height);
    
    var rotationMatrix:Matrix = new Matrix();
    rotationMatrix.rotate(Math.PI);
    rotationMatrix.translate(img.width, img.height);
    
    tempBitmap.draw(box_mc, rotationMatrix);
    var output:Bitmap = new Bitmap(tempBitmap);
    
    addChild(output);
    

    I didn’t mess with the scaling, you can do that yourself I guess. The one I put on the stage is on the right, the bitmapData drawn one is top left of stage, and correctly inverted.

    UPDATE

    Also have a look at fl.motion.MatrixTransformer as per 32bitkid comment below!

    enter image description here

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

Sidebar

Related Questions

I have a very simple AS3 app that draws few circles using drawing api
I have a movie clip that holds one bitmap image, some simple AS3 to
I'm working on a small game in Flash (AS3) that generates levels using small
We have Bitmap and Bitmapdata objects now. And when using the webcam, we can
I have a Bitmap that I want to enlarge programatically to ~1.5x or 2x
I have a bitmap that contains 24x24 icons. I would like to use it
I have a bitmap in as3, I want its height to be 800, I
In pure AS3, I have a pixelbender and a large bitmap. The pixelbender is
I have a bitmap that I want to save to the sd card. I
I currently have a flash (AS3) project which consists of a sketchpad onto which

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.