Out of the top of my head: >> function duplicateMovieClipImage(from:MovieClip, target:MovieClip){ >> var visuals = new flash.display.BitmapData(from._width, >> from._height); var m:Matrix = new Matrix(); //dont forget to import this m.scale (from._xscale/100, from._yscale/100); >> visuals.draw(from, m); >> target.attachBitmap(visuals, 1,"auto",true); >> >> }
On Thu, Mar 5, 2009 at 12:54 PM, natalia Vikhtinskaya <natavi.m...@gmail.com > wrote: > How to create img2 correctly? > > 2009/3/4 Hans Wichman <j.c.wich...@objectpainters.com>: > > Hi, > > > > you create a clip based on mc's width, called img. > > then you scale image, so its width is half of what it used to be. > > Then you draw img into img2. Img2's size is based on half the height and > > width, but the draw method ignores those transformation, so it draws an > > unscaled version of img in img2. > > > > regards > > JC > > > > On Sun, Mar 1, 2009 at 3:58 PM, natalia Vikhtinskaya > > <natavi.m...@gmail.com>wrote: > > > >> Hi > >> Please explain what is wrong in this code: > >> function duplicateMovieClipImage(from:MovieClip, target:MovieClip){ > >> var visuals = new flash.display.BitmapData(from._width, > >> from._height); > >> visuals.draw(from); > >> target.attachBitmap(visuals, 1,"auto",true); > >> > >> } > >> > >> duplicateMovieClipImage(mc,img) > >> img._xscale=50; > >> img._yscale=50; > >> duplicateMovieClipImage(img,img2) > >> I expected that img1 and img2 have the same scale. Instead of that > >> img2 show 50% of mc. > >> _______________________________________________ > >> Flashcoders mailing list > >> Flashcoders@chattyfig.figleaf.com > >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > >> > > _______________________________________________ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders