Re: [Flashcoders] smoothly rotating a dynamic loaded image with AS2
Just a thought. Maybe try setting the smoothing to the MC the bitmap is loaded into instead of your bitmap?? Something like this.. http://www.kaourantin.net/2005/12/dynamically-loading-bitmaps-with.html I used something similar in a mouseWheel controlled "shrink and zoom" on a Dynamically loaded image and it kept everything smooth, I dont know about rotating though. But I think it would work fine. HTH, Karl On Sep 3, 2009, at 2:18 AM, Cor wrote: My guess is that you can't see the difference in this line: mcBanner2._rotation=-3; try mcBanner2._rotation=-30; to see if it rotates at all. And to rotate constantly you need to create a function which runs continuously with onEnterFrame or timer. HTH Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Isaac Alves Sent: woensdag 2 september 2009 23:59 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] smoothly rotating a dynamic loaded image with AS2 Hello list, i-d like to smoothly rotate an image loaded in an as2 swf file. no tween, just rotate and leave it there. it doesn´t work. i´ve tried lot of things and no success. actually i-m used to as2, i don´t understand as2 very well. here is the code: mcBanner2.loadMovie(linksBanners[1]); var bitmap:BitmapData=new BitmapData(mcBanner2._width,mcBanner2._height,true,0); var charObj:Object=new Object(); charObj.rotation = -3; var angle_in_radians = Math.PI * 2 * (charObj.rotation / 360); var rotationMatrix:Matrix = new Matrix(); // rotationMatrix.translate(-16,-16); rotationMatrix.rotate(0.1); // rotationMatrix.translate(16,16); var rectangleTrans:Transform = new Transform(mcBanner2); rectangleTrans.matrix = rotationMatrix; var myColorTransform:ColorTransform = new ColorTransform(0, 0, 1, 1, 0, 0, 255, 0); var myRectangle:Rectangle = new Rectangle(0, 0, 100, 80); var smooth:Boolean = true; bitmap.draw(mcBanner2,rotationMatrix, myColorTransform, "normal", myRectangle, smooth); // mcBanner2._rotation=-3; // this doesn´t work. mcBanner2.attachBitmap(bitmap,100,"auto",true); mcBanner2._xscale=100; mcBanner2._yscale=100; ___ 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 Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] smoothly rotating a dynamic loaded image with AS2
My guess is that you can't see the difference in this line: mcBanner2._rotation=-3; try mcBanner2._rotation=-30; to see if it rotates at all. And to rotate constantly you need to create a function which runs continuously with onEnterFrame or timer. HTH Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Isaac Alves Sent: woensdag 2 september 2009 23:59 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] smoothly rotating a dynamic loaded image with AS2 Hello list, i-d like to smoothly rotate an image loaded in an as2 swf file. no tween, just rotate and leave it there. it doesn´t work. i´ve tried lot of things and no success. actually i-m used to as2, i don´t understand as2 very well. here is the code: mcBanner2.loadMovie(linksBanners[1]); var bitmap:BitmapData=new BitmapData(mcBanner2._width,mcBanner2._height,true,0); var charObj:Object=new Object(); charObj.rotation = -3; var angle_in_radians = Math.PI * 2 * (charObj.rotation / 360); var rotationMatrix:Matrix = new Matrix(); // rotationMatrix.translate(-16,-16); rotationMatrix.rotate(0.1); // rotationMatrix.translate(16,16); var rectangleTrans:Transform = new Transform(mcBanner2); rectangleTrans.matrix = rotationMatrix; var myColorTransform:ColorTransform = new ColorTransform(0, 0, 1, 1, 0, 0, 255, 0); var myRectangle:Rectangle = new Rectangle(0, 0, 100, 80); var smooth:Boolean = true; bitmap.draw(mcBanner2,rotationMatrix, myColorTransform, "normal", myRectangle, smooth); // mcBanner2._rotation=-3; // this doesn´t work. mcBanner2.attachBitmap(bitmap,100,"auto",true); mcBanner2._xscale=100; mcBanner2._yscale=100; ___ 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] smoothly rotating a dynamic loaded image with AS2
Hello list, i-d like to smoothly rotate an image loaded in an as2 swf file. no tween, just rotate and leave it there. it doesn´t work. i´ve tried lot of things and no success. actually i-m used to as2, i don´t understand as2 very well. here is the code: mcBanner2.loadMovie(linksBanners[1]); var bitmap:BitmapData=new BitmapData(mcBanner2._width,mcBanner2._height,true,0); var charObj:Object=new Object(); charObj.rotation = -3; var angle_in_radians = Math.PI * 2 * (charObj.rotation / 360); var rotationMatrix:Matrix = new Matrix(); // rotationMatrix.translate(-16,-16); rotationMatrix.rotate(0.1); // rotationMatrix.translate(16,16); var rectangleTrans:Transform = new Transform(mcBanner2); rectangleTrans.matrix = rotationMatrix; var myColorTransform:ColorTransform = new ColorTransform(0, 0, 1, 1, 0, 0, 255, 0); var myRectangle:Rectangle = new Rectangle(0, 0, 100, 80); var smooth:Boolean = true; bitmap.draw(mcBanner2,rotationMatrix, myColorTransform, "normal", myRectangle, smooth); // mcBanner2._rotation=-3; // this doesn´t work. mcBanner2.attachBitmap(bitmap,100,"auto",true); mcBanner2._xscale=100; mcBanner2._yscale=100; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders