Loading external image with preloading and getting width and height
- June 26th, 2010
- Posted in Uncategorized
- Write comment
I’ve tried loadComplete but oddly it didnt work..then I tried on EnterFrame and oddly it worked O.o
Here is the code
//Loading Images
function LoadImage(image, targetMC) {
targetMC.loadMovie(image);
this.onEnterFrame = function() {
var Percent = Math.ceil(targetMC.getBytesLoaded()/targetMC.getBytesTotal()*100);
if (Percent == 100) {
trace(“Width: “+targetMC._width);
trace(“Height: “+targetMC._height);
delete this.onEnterFrame;
}
};
}
just then we call the function that way
LoadImage and it should work fine ^_^
No comments yet.