Re: [Flashcoders] Rotate in absolute center AS3
Hi, The code below I copied from somewhere else and have saved it to eventually test. So, I cannot verify that it *definately* does the trick. However, using rotateAroundExternalPoint should allow you to rotate around the center. You'd just need to specify the clip's center. This example code that I copied is for a MovieClip, but I think it will work with any display object. import fl.motion.*; var m=mc1.transform.matrix; MatrixTransformer.rotateAroundExternalPoint (m,100,100,5); //transfrom original mc mc1.transform.matrix=m; Jobe Makar http://www.electrotank.com http://www.electro-server.com phone: 252-627-8026 mobile: 919-609-0408 fax: 919-882-1121 ___ Flashcoders@chattyfig.figleaf.com 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
Re: [Flashcoders] Rotate in absolute center AS3
Presumably this is a programatically created bitmap. I don't know if you can set the registration point of the movieclip or sprite within which I assume it lives programatically within AS3 programatically (sorry, haven't looked into this since AS2), however, even if you can, the principal is the same as doing it manually. Calculate the bitmap's width and height, divide them by 2 and position the x and y to be minus these figures, as the default for the registration point is x:0 and y:0 (top left hand corber). So, what ever the bitmap width and hight, you would set (this is formula, not code btw): bitmap x = bitmap x - (bitmap width / 2) bitmap y = bitmap y - (bitmap height / 2) S. > Hey there, I need rotate Bitmap texture in AS3. > > I use > > object.rotate = 45 > > unhappyness the rotate is no absulute center. The rotate is corner high > left. What is happends? How to set position pivot in center. > > I need the texture rotate in with the self center. > > Thank a lot > ___ > Flashcoders@chattyfig.figleaf.com > 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 > ___ Flashcoders@chattyfig.figleaf.com 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
[Flashcoders] Rotate in absolute center AS3
Hey there, I need rotate Bitmap texture in AS3. I use object.rotate = 45 unhappyness the rotate is no absulute center. The rotate is corner high left. What is happends? How to set position pivot in center. I need the texture rotate in with the self center. Thank a lot ___ Flashcoders@chattyfig.figleaf.com 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