Application有关背景的几个属性:
- backgroundGradientAlphas 背景透明度渐变,是一个数组,默认是[1.0,1.0]
- backgroundGradientColors 背景颜色渐变,也是一个数组。
上面两个是application特有的。下面是继承
Container 的属性
- backgroundAlpha 背景的透明度 (0到1)
- backgroundAttachment 背景的固定状态 两种选项 fixed(固定) scroll(随滚动条的滚动移动)
- backgroundDisabledColor 禁用背景颜色
- backgroundColor 背景颜色
- backgroundImage 可以是图片 也可以是swf
- backgroundSize 背景的尺寸 常用的有 100% (就是拉伸到舞台的大小) auto(背景图片的原始大小)
例如:设置一个application用swf 做背景 而且让它不随滚动条滚动,并且拉伸至浏览器大小。
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" horizontalAlign="center"backgroundSize="100%" pageTitle="你的页面标题" backgroundAttachment="fixed" backgroundImage="13.swf"> </mx:Application>