+ -
当前位置:首页 → 问答吧 → 引导动画问题

引导动画问题

时间:2011-02-12

来源:互联网

网站的引导动画,如何让它自动适用不同大小的屏幕?比如我在台式机上做的时候,设置的动画大小是刚好铺满屏幕的,可到了宽屏显示器后,两边就会留白,请问如何解决?
还一个问题是,我做的动画在自己的电脑上无论预览和导出swf都显示正常,可是到另一台电脑上就显示不正常了,这是什么问题啊···

作者: shuangyulei   发布时间: 2011-02-12


http://www.google.com.hk/search?q=resize%20flash023&hl=zh-CN&lr=lang_zh-CN&ie=UTF-8&oe=UTF-8&client=aff-cs-gosurf
复制内容到剪贴板
代码:
package{
import flash.display.Bitmap;
    import flash.display.Sprite;
import flash.geom.Matrix;
import flash.display.Loader;
    import flash.events.Event;
    import flash.net.URLRequest;
    /**
    * ...
    * @author FLASH023
    */
    public class Main extends Sprite {
  private var loader:Loader;
  private var bg:Bitmap  ;
        public function Main():void {
   init();   
        }
  private function init():void {
   imgLoader ("image.jpg");
   stage.align = "TL";
   stage.scaleMode = "noScale";
   stage.addEventListener (Event.RESIZE, onResize);
   stage.addEventListener (Event.FULLSCREEN, onResize);
  }
  private function onResize(_evt:Event):void {
   if (bg) {
    bg.width = stage.stageWidth;
    bg.height = stage.stageHeight;
   }
  }
        private function imgLoader(_path:String ):void{
            loader = new Loader;
            loader.contentLoaderInfo .addEventListener (Event.COMPLETE , imageComplete);
            loader.load(new URLRequest (_path));
        }
        private function imageComplete(_evt:Event):void{
            bg  = _evt.target.content as Bitmap;
   onResize(null);
   addChild (bg);
            //-------------------
            loader.contentLoaderInfo .removeEventListener (Event.COMPLETE , imageComplete);
            loader = null;
        }  
    }
}
复制代码如果是AS2:
stage.align = "TL";
   stage.scaleMode = "noScale";
   stage.addEventListener (Event.RESIZE, onResize);
   stage.addEventListener (Event.FULLSCREEN, onResize);
参照以上几行改写

同类型参考帖:
http://share.zcool.com.cn/archiver/?tid-71283.html
http://flash.9ria.com/thread-43626-1-1.html
http://flash.9ria.com/viewthread.php?tid=47626&rpid=423653&ordertype=0&page=1#pid423653
http://space.flash8.net/BBS/thread-381767-1-1.html
http://flash.9ria.com/archiver/tid-43626.html
http://flash.9ria.com/viewthread.php?tid=43626&rpid=408714&ordertype=0&page=1#pid408714
http://bbs.blueidea.com/viewthread.php?action=printable&tid=2969923

作者: flash023   发布时间: 2011-02-12

终极讨厌的回复总是如此雷人

作者: HBrO   发布时间: 2011-02-12