Hey, I'm aijun.

aijun

Flash自适应屏幕宽度代码

Written by aijunSeptember 23rd, 2014 5:07 PM1 CommentsFiled under: 资源分享

本代码可以自适应任何屏幕的宽度, 并且主内容居中显示,完美解决1920/1440屏幕宽度与1024屏幕宽度冲突的问题。其实代码非常简单, 加到Flash主场景第一桢即可

Stage.scaleMode = "noScale";
onEnterFrame = function(){
Fish_bg._width = Stage.width;
}

HTML应用代码:

<embed width="100%" height="230" src="/images/banner.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" menu="true" loop="true" play="true" scale=""></embed>

TAGS: flash