你得确定你已经准备好了
image.scaleContent = true;
image.maintainAspectRatio = false;
这应该将内容缩放到SWF加载程序的大小,并使其变形,从而填充图像组件的整个区域。
这是它的一个快速版本
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
horizontalAlign="center"
width="100" height="100"
verticalGap="0" borderStyle="solid"
initialize="onLoad()"
horizontalScrollPolicy="off"
verticalScrollPolicy="off">
<mx:Canvas width="100%" height="100%" id="PictureBox" horizontalScrollPolicy="off"
verticalScrollPolicy="off" />
<mx:Label id="NameLabel" height="20%" width="100%"/>
<mx:Script>
<![CDATA[
import mx.controls.Image;
private function onLoad():void
{
var image : Image = new Image()
image.source = "http://i.stackoverflow.com/Content/Img/stackoverflow-logo-250.png";
image.scaleContent = true;
image.maintainAspectRatio =false;
image.percentWidth = 100;
image.percentHeight = 100;
PictureBox.addChild(image);
}
]]>
</mx:Script>
</mx:VBox>