This content has been marked as final. Show 2 replies
your image doesn't resize in the movieClip because you apply width and height while the image isn't totaly loaded into the movieClip.
Once the image is completely loaded, the movieClip get the width/height image properties, forgetting the ones you tell it to use.
If you want to resize your image, you have to :
- wait untill it s completely loaded before applying with/height properties.
- use the _xscale and _yscale properties whenever (they can be applied and remembered even if the image isn't totaly loaded)
Since the graphic isn't there yet, the only width and height the clip has to relate to is 0 0 meaning that the xscale/yscale which are set when you set a _width _height to an object (relating to it's total _wdith _height) stay 100.
You have to add an event to trigger the scale function once the image is loaded. Since I'm not very familiar to AS3 loading I'm not sure, but back in AS2 a movieclip could have a bytesLoaded equal to the bytesTotal but still could have no image drawn (I think even using an onEnterFrame function the image sometimes could wait a frame or two to be drawn once loaded). So the proper check to really see if an image had been loaded into a movieclip was to check the _width to be above 0. I suggest you do the same. It will be alot less performance demanding than drawing a circle, also, if your circle's radius does not match the image size the scale of the image once loaded could be off.