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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:54:03+00:00 2026-05-28T19:54:03+00:00

I am creating a program that is effectively an sprite creator. I’m very new

  • 0

I am creating a program that is effectively an sprite creator. I’m very new to AS3, but I know JQuery, JS, PHP, etc. After going through multiple steps of selecting pieces to customize a character, you are supposed to be able to download the final product using fileReference(). Everything works, and I can download the image in the end, but the problem is that I cannot capture all of several movieclips on the stage, I can only capture one. Maybe this will help clarify:

// add listener to the download button
dl_b.addEventListener(MouseEvent.CLICK, save_emote); 

function save_emote(e:MouseEvent):void{ 
    var bData:BitmapData = new BitmapData(50, 50); 
    var bData_eyes:BitmapData = new BitmapData(50, 50); 


    bData.draw(emptyMC_mc);
    bData_eyes.draw(emptyMC_eyes);

    // none of these worked, so they have been commented out
    //bData.draw(emptyMC_a); 
    //bData.draw(emptyMC_mouth); 
    //bData.draw(emptyMC_hand_l); 
    //bData.draw(emptyMC_hand_r); 


    // possible to use two bitmapDatas to merge into single?
    var byteArray:ByteArray = PNGEncoder.encode(bData);

    var fileReference:FileReference = new FileReference();
    fileReference.save(byteArray, 'myEmote.png');
    replay_b.visible = true; 
    upload_b.visible = true; 
    back_b.visible = false; 
    user_color.clear(); 
    user_eyes.clear(); 
    user_mouth.clear(); 
    user_a.clear(); 
    hand_l.clear(); 
    hand_r.clear(); 
    mouth_coords.clear(); 
    eye_coords.clear(); 
}

I really have no idea how I could get it to work. I’ve tried using the .merge() method, I’ve tried Googling for days now, and I’ve tried to merge them by creating two separate bitmapData objects and then drawing one in the other. Nothing has really worked for me.

If you want to take a look at the program and click your way through it to get to the point at which you saved the image, you can try it out here: http://dl.dropbox.com/u/3666815/mote-machine-main.html

If you save the image at the end, you’ll see the issue at hand. I haven’t been able to find a good answer, so if anyone could help, it’ll be thoroughly appreciated!

Thanks in advance!

Edit: Here is how I set it up with a Sprite as a container, but now it seems to be saving a blank canvas.

    var emote:Sprite = new Sprite(); 
    emote.addChild(emptyMC_mc); 
    emote.addChild(emptyMC_eyes); 
    emote.addChild(emptyMC_hand_l); 
    emote.addChild(emptyMC_hand_r); 
    emote.addChild(emptyMC_mouth); 
    if(user_a.data.accessory != "none"){
            emote.addChild(emptyMC_a); 
    } 

    var bData:BitmapData = new BitmapData(80, 80); 

    bData.draw(emote);

Could it be that each of the movieclips I’m adding to the sprite have children of their own?

  • 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-28T19:54:04+00:00Added an answer on May 28, 2026 at 7:54 pm

    If you place your bitmaps into some sort of a display object container, like a Sprite, you can later use the “draw” and/or “copyPixels” methods to grab the bitmap data of the container, which will retain all of the children in their proper place. That should do what you need.

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

Sidebar

Related Questions

I have some code that effectively does this : File file = new File(C:\\Program
I'm creating a program that invents a new Sudoku puzzle. The way I initially
I am creating a program that allows you to paste text but it will
I am creating a program that will be installed using the .net installer project.
I am creating a program that needs to store the user's data in encrypted
I am creating a program that displays a popup at certain times (just like
I'm creating a program that authenticates from a before it runs. I also want
I have been tasked with creating a program that will generate an amortization schedule.
Let's say I'm creating a program in C that needs to use a tempfile.
I'm creating an initialising function for the class 'Room', and found that the program

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.