PDA

View Full Version : OnResize Skewing My Image



tomyknoker
03-27-2007, 06:59 PM
I have the following and have managed to be able to use onResize to resize just my mc 'mcl', it currently fits horizontally but not vertically, so it's stretching, I want to stretch 100% on the left and right hand side but in proportion... Any ideas?



var myClip = this.createEmptyMovieClip("mcl", this.getNextHighestDepth());
var myLoader = new MovieClipLoader();
var myListener = new Object();
var myTest = random(6) + ".jpg";

Stage.align = "TL"; // Position the movie at top, center
Stage.scaleMode = "noScale"; // Prevent scaling (required!)

myListener.onResize = function (e:Object):Void {
var sw:Number = Stage.width;
var sh:Number = Stage.height;
mcl._width = sw;
trace("New width: " + Stage.width);
};

myListener.onLoadInit = function (mcl) {
trace("load init");
mcl._alpha=0;
mcl.onEnterFrame=function(){
mcl._alpha +=15;

if(mcl._alpha >=100){
delete mcl.onEnterFrame;
}
}
};

Stage.addListener(myListener);
myLoader.addListener(myListener);
myLoader.loadClip(myTest,myClip);