• ActionScript3.0平铺由外部加载的图片


    var backImage:MovieClip = new MovieClip();
    
    this.addChild (backImage);
    
    var loader:Loader = new Loader();
    loader.load (new URLRequest("http://www.baidu.com/img/logo-yy.gif"));
    loader.contentLoaderInfo.addEventListener (Event.COMPLETE,showLoadResult);
    
    function showLoadResult (event:Event):void {
            var _bitmap:Bitmap = Bitmap(loader.content);
            var matrix:Matrix = new Matrix(1, 0, 0, 1, this.stage.stageWidth / 2, this.stage.stageHeight / 2);
            var sampleSprite:Sprite = new Sprite();
    		//sampleSprite.width=500;
    		//sampleSprite.height=500;
            sampleSprite.graphics.beginBitmapFill (_bitmap.bitmapData, matrix , true , true);
            //sampleSprite.graphics.drawRect (this.stage.stageWidth / 2, this.stage.stageHeight / 2, _bitmap.width, _bitmap.height);
    		 sampleSprite.graphics.drawRect (0, 0, this.stage.stageWidth, this.stage.stageHeight);
            sampleSprite.graphics.endFill ();
            backImage.addChild (sampleSprite);
    }
    
  • 相关阅读:
    Python 函数 之 目录
    python---------匿名函数
    python-------递归函数
    python-----内置函数
    hibernate.cfg.xml
    struts2 工作原理
    拦截器
    js制作 子菜单
    struts---最简单实例步骤
    常用标签---地址----
  • 原文地址:https://www.cnblogs.com/Lewis/p/1961247.html
Copyright © 2020-2023  润新知