Skip to main content
Known Participant
August 18, 2011
Answered

Merge two images into a single MovieClip?

  • August 18, 2011
  • 1 reply
  • 485 views

Hello

I have two images,

var BigImage:BigPhoto = new BigPhoto()  // a PNG of 640x960 pixels

addChild(BigImage)

var Thumb:LittlePhoto = new LittlePhoto() // a PNG of 140x220 Pixels

addChild(Thumb)

I need create and save another image that is the Big as Background and the little inside of this at position x=40 y=200

Sorry for my English but I need to "embed" the little photo inside of the big Photo, I whish culd be understand

Anybody know how is the code in AS3 CS5.5 to do this?

Thank you

This topic has been closed for replies.
Correct answer Colin Holgate

If you add the big image to something, then add the little image to the same thing after setting its x and y, you can then draw the container into something else. I imagine you want that to go back to the photo gallery, as discussed here:

http://forums.adobe.com/message/3870150#3870150

So, that script changed to what you're asking now would read:

var BigImage:BigPhoto = new BigPhoto();

var Thumb:LittlePhoto = new LittlePhoto();

Thumb.x = 40;

Thumb.y = 200;

var holdermc:MovieClip = new MovieClip();
holdermc.addChild(BigImage);
holdermc.addChild(Thumb);
 var cameraRoll:CameraRoll = new CameraRoll();  
var bitmapData:BitmapData = new BitmapData(holdermc.width, holdermc.height);
bitmapData.draw(holdermc);
cameraRoll.addBitmapData(bitmapData);

1 reply

Colin Holgate
Colin HolgateCorrect answer
Inspiring
August 18, 2011

If you add the big image to something, then add the little image to the same thing after setting its x and y, you can then draw the container into something else. I imagine you want that to go back to the photo gallery, as discussed here:

http://forums.adobe.com/message/3870150#3870150

So, that script changed to what you're asking now would read:

var BigImage:BigPhoto = new BigPhoto();

var Thumb:LittlePhoto = new LittlePhoto();

Thumb.x = 40;

Thumb.y = 200;

var holdermc:MovieClip = new MovieClip();
holdermc.addChild(BigImage);
holdermc.addChild(Thumb);
 var cameraRoll:CameraRoll = new CameraRoll();  
var bitmapData:BitmapData = new BitmapData(holdermc.width, holdermc.height);
bitmapData.draw(holdermc);
cameraRoll.addBitmapData(bitmapData);

Known Participant
August 19, 2011

Thank You, Works great! ...