FORUMS: list search recent posts

Scale/rotate multiple objects around their own centers

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mariusz Kohut
Scale/rotate multiple objects around their own centers
on Feb 10, 2013 at 11:40:10 pm

Is there a way to scale or rotate multiple objects around their own center?

The only way i know is to scale them one by one to maintain their center position. Knowing how to scale multiple items maintaining their center would be a huge time saver.

Thanks in advance.

Return to posts index

demetri tashie
Re: Scale/rotate multiple objects around their own centers
on Feb 11, 2013 at 11:43:56 pm

seems hard to do on the stage, so why not do it programatically?

put the movieclip names that you want to transform into an array, and then loop through the array to make those transformations.

for movieclips with the instance names of 'a_mc', 'b_mc' and 'c_mc', this code would transform their rotation and scale:

var arr:Array = [a_mc, b_mc, c_mc]; // put all your movieclip names here
var arrLen:uint = arr.length; // this makes the length of the array a constant
var i:uint=0; // a useful variable to use in the 'for loop'

function rotatesScales():void {

for ( i; i < arrLen; i++) {
arr[i].rotation=45; // rotate whatever degree you want
arr[i].scaleX = .5; // scale x
arr[i].scaleY = .5; // scale y


rotatesScales(); runs the function

i hope that helps. just be careful of the clips' registration point is set where you expect it to be ( the center, upper left corner, etc)

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved