Claudia,
Give this a try:
(watch the wrap)
import flash.display.BitmapData;
import flash.geom.Matrix;
import flash.geom.Rectangle;
import flash.geom.Point;
//set a reference to your original MovieClip
var source_mc:MovieClip = originalMovieClip;
this.createEmptyMovieClip("mirror_mc", this.getNextHighestDepth());
var x:Number = source_mc._x + (source_mc._width*2);
var y:Number = source_mc._y;
mirror_mc._x = x;
mirror_mc._y = y;
var sourceBmp:BitmapData = new
BitmapData(source_mc._width,source_mc._height);
sourceBmp.draw(source_mc,new Matrix());
var bmp:BitmapData = new BitmapData(source_mc._width, source_mc._height,
true, 0xFF000000);
var rect:Rectangle = new Rectangle(0, 0, source_mc._width,
source_mc._height);
var point:Point = new Point(0, 0);
bmp.copyPixels(sourceBmp, rect, point);
mirror_mc.attachBitmap(bmp, 1);
//flip it horizontally
mc._xscale = -100;
HTH
-Keith
http://home.mn.rr.com/keithreinfeld
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Claudia
Barnal
Sent: Monday, July 10, 2006 12:04 AM
To: flashcoders
Subject: [Flashcoders] BitmapData manipulation. Mirror effect.
Hi,
I'm trying to manipulate a BitmapData, but am slightly lost,
so any input on how I could manage would be greatly appreciated.
What I need to do is to make a mirror image of the
BitmapData and leave is as one single BitmabData.
What I am trying to do is something like this pseudo code:
bd = new BitmapData(100, 100);
// Assign data to bd
bdMirror = new BitmapData(100, 100);
// copy bd into bdMirror
// turn bdMirror (so that it is like a mirror image of bd)
// merge bd and bdMirror into one BitmapData which should be
200x100
I have tried, but the documentation has me a little bit
lost, and I can't find any specific information.And if you only have time to
write down and help me with one of the steps, I would still appreciate it a
lot, as I'm sure others could help me out with the other steps.
Thanks a lot for any help you can give me,Claudia
_________________________________________________________________
Be one of the first to try Windows Live Mail.
http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-491
1fb2b2e6d_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com