网上AS3.0自适应网页的列子不多,所以自己做一个
html方面
使用发布以后在body中的<param>标签和<embed>标签的width和height属性都改为100%,<script>标签中的width和height属性改为100%,<noscript>标签删除。
flash方面
var fullmc:MovieClip=new full();
stage.scaleMode = StageScaleMode.NO_SCALE;//
stage.align = StageAlign.TOP_LEFT;//
stage.addEventListener(Event.RESIZE, resizeHandler);//resize侦听
addChild(fullmc);
fullmc.width=stage.stageWidth;//初始化fullmc宽度
fullmc.height=stage.stageHeight;//初始化fullmc高度
fullmc.x=stage.stageWidth/2;//初始化X轴
fullmc.y=stage.stageHeight/2;//初始化Y轴
function resizeHandler(e:Event):void//侦听函数
{
fullmc.width=stage.stageWidth;
fullmc.height=stage.stageHeight;
fullmc.x=stage.stageWidth/2;
fullmc.y=stage.stageHeight/2;
}