wvxvw
11-12-2006, 07:34 PM
Hi all!
Here's my problem:
I have a function that redraws the container clip every frame. While the function is running I need to download an image inside the container and to resize the image to the size of the container. The particular problem is that if the picture is bigger than the container, when it'll be downloaded the size of the container will be the same that of the picture.
Here's a simplified code:
var MCL:MovieClipLoader = new MovieClipLoader();
var MCLL:Object = {};
MCLL.onLoadComplete = function(mc:MovieClip){
/*
When this is called, the mc's width and height are 0
*/
}
MCL.addListener(MCLL);
var container:MovieClip = _root.createEmptyMovieClip("container", 0);
container.h=5;
container.w=5;
_root.onEnterFrame = function(){
container.clear();
container.beginFill(0, 100);
container.moveTo(0, 0);
container.lineTo(container.w, 0);
container.lineTo(container.w, container.h);
container.lineTo(0, container.h);
container.lineTo(0, 0);
container.endFill();
container.w+=5;
container.h+=5;
}
MCL.loadClip(container, "image.jpg");
Thank you for any help.
Here's my problem:
I have a function that redraws the container clip every frame. While the function is running I need to download an image inside the container and to resize the image to the size of the container. The particular problem is that if the picture is bigger than the container, when it'll be downloaded the size of the container will be the same that of the picture.
Here's a simplified code:
var MCL:MovieClipLoader = new MovieClipLoader();
var MCLL:Object = {};
MCLL.onLoadComplete = function(mc:MovieClip){
/*
When this is called, the mc's width and height are 0
*/
}
MCL.addListener(MCLL);
var container:MovieClip = _root.createEmptyMovieClip("container", 0);
container.h=5;
container.w=5;
_root.onEnterFrame = function(){
container.clear();
container.beginFill(0, 100);
container.moveTo(0, 0);
container.lineTo(container.w, 0);
container.lineTo(container.w, container.h);
container.lineTo(0, container.h);
container.lineTo(0, 0);
container.endFill();
container.w+=5;
container.h+=5;
}
MCL.loadClip(container, "image.jpg");
Thank you for any help.