Skip to main content
Known Participant
Aug 18, 2011 7:47 PM UTC
Answered

Merge two images into a single MovieClip?

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 is closed to new replies. Start a new post to keep the conversation going.
Colin Holgate
Colin HolgateCorrect answer
Inspiring
Aug 18, 2011 8:06 PM UTC

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);

2 replies

Colin Holgate
Colin HolgateCorrect answer
Inspiring
Aug 18, 2011 8:06 PM UTC

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);

Translate
Known Participant
Aug 19, 2011 1:07 AM UTC

Thank You, Works great! ...

Translate