How do I get 开发者_运维知识库an exact width and height of a MovieClip if it was scaled on stage resize?
for example if I have:
stage.scaleMode=StageScaleMode.EXACT_FIT;
stage.addEventListener(MouseEvent.MOUSE_DOWN, checkSize);
function checkSize(e:MouseEvent):void{
trace(mc.width);
}
It will always output the same width and height no matter how big or small the stage is. Is there anyway to get exact current size?
Thank you.
The current size of your MovieClip is as shown by your trace()
I don't think there's a way to determine (easily) how many pixels down and across your MovieClip is with EXACT_FIT
enabled.
Try using either mc.measuredWidth, or mc.width * mc.scaleX != 1? mc.scaleX:scaleX;
精彩评论