Don't scale the movieclip itself; use setMask to create a mask mc on
the mc and scale that. Here's s some code (freely adapted from adobe's
help examples) to create a draggable mask you can resize in the
actionscript:
// BEFORE YOU BEGIN....
// 1.) Create a shape mc on the stage and give it an instance name of
rectMask_mc
// 2.) substitute your own image path for the one I've used: images/
fullsized/tk.png
// Set dimensions of your 'cropped' mc:
var maskWidth:Number = 250;
var maskHeight:Number = 250;
this.createEmptyMovieClip("img_mc", 10);
var mclListener:Object = new Object();
function cropThis(howWide:Number,howTall:Number){
_level0.rectMask_mc._width = howWide;
_level0.rectMask_mc._height = howTall;
_level0.rectMask_mc.onPress =function(){
this.startDrag();
}
_level0.rectMask_mc.onRelease =function(){
this.stopDrag();
}
}
mclListener.onLoadInit = function(target_mc:MovieClip):Void {
target_mc.setMask(rectMask_mc);
cropThis(maskWidth,maskHeight);
}
var my_mcl:MovieClipLoader = new MovieClipLoader();
my_mcl.addListener(mclListener);
my_mcl.loadClip("images/fullsized/tk.png", img_mc);
On Nov 8, 2:43 pm, Stefan Dreyer <stefan.dreyer+n...@ddnetservice.net>
wrote:
> Hello,
> how can i crop a movieclip? if i use _width, the mc will be scaled. But
> i wish to crop the image.