I have a movie clip that I scaled by hand in the timeline.
I am now trying to get the WIDTH and HEIGHT with action script so I can load another movieClip into it and make it the same size.
However when I do the following code I can't position it correctly because the scale is WIDTH and HEIGHT displays the original size and not showing the scaled size cordinates. So when I place the new clip inside of it the I can't make it be the same WIDTH and HEIGHT as the rescaled clip;
ScaledMC.addChild(myMC);
myMC.x = - ScaledMC.width /2; //Because the MC registration is in the center
A work around could be some code to detect the x and y positions of the BOUNDARIES of the clip and where they are located on the stage.
Thanks for your time.
UPDATE: 4-25-12
I am posting full code of what I am trying to do and including FLA. When you click on the girl I need her to load into another movie clip. However the movie clip is scaled so when she gets loaded her position suddenly changes. I need it to look like she hasn't moved and stays in the same place.
import flash.geom.Rectangle;
var Girlx = Girl.x;
var Girly = Girl.y;
var b:Rectangle;
b = Room.ChalkBoard.getBounds(this);
trace(b);
Room.ChalkBoard.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
function fl_ClickToDrag(event:MouseEvent):void
{
Room.ChalkBoard.startDrag();
}
stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
function fl_ReleaseToDrop(event:MouseEvent):void
{
Room.ChalkBoard.stopDrag();
b = Room.ChalkBoard.getBounds(this);
}
Girl.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
{
//Room.ChalkBoard.scaleX = 1;
// Room.ChalkBoard.scaleY = 1;
Room.ChalkBoard.addChild(Girl);
// I NEED TO KNOW HOW TO SCALE GIRL BACK TO SAME SIZE
// EXAMPLE:
Girl.scaleY = 1 + Room.ChalkBoard.scaleY;
Girl.scaleX = 1 + Room.ChalkBoard.scaleX;
Girl.x = Girlx - b.x; /// This formula works if Room is at scaleX is 1;
Girl.y = Girly - b.y; /// This formula works if Room is at scaleY is 1;
}
HERE IS THE FLA: http://www.EdVizenor.com/Girl.fla