What is wrong with this code?

Hi!
I am doing this for test purposes and it is scaling up the image.I just want to animate the square and after it finishes scaling up I want to load an image inside this square. But it is scaling up the image as well.

here is my code:


package
{
    import flash.display.Loader;
    import flash.display.MovieClip;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.net.URLRequest;
    import gs.TweenMax;
    
    public class mySite extends MovieClip
    {
        var boxBack : Sprite = new Sprite();
        var palce : MovieClip = new MovieClip();
        var imgLoader : Loader = new Loader();        
        
        public function mySite()
        {
            init();
        }
        
        private function init():void
        {
            createBoxBack();
        }
        
        private function createBoxBack():void
        {
            boxBack.graphics.lineStyle(1, 0, 100);
            boxBack.graphics.drawRect(5,0, 50,50);
            addChild(boxBack);
            TweenMax.to(boxBack, 1, { scaleX:10, scaleY:10 } );
            
            imgLoader.load(new URLRequest("imagem.jpg"));
            imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleto);
            
        }
        
        private function onCompleto(e:Event):void
        {
            palce.addChild(imgLoader);
            boxBack.addChild(palce);
            
        }
        
    }
}

palce.addChild(imgLoader);
boxBack.addChild(palce);

You’re adding the loader into the boxBack … how can you be surprised that the image scales with the box when you tween it :stuck_out_tongue:

but How would I do then? Because I want the image loaded to be inside this box I am animating but I dont want the image to be scaled up.

You can also create one more mc and into it load the image after its load you set up yourmc.width = 100; yourmc.height = 100;