---
title: "as3 load image"
author: "cainwise"
date: "2011-11-26T23:59:02Z"
tags: []
categories: ["Web前端"]
slug: "as3-load-image"
draft: false
lastmod: "2011-11-26T23:59:02Z"
id: 1279133
url: "https://cainwise.iteye.com/blog/1279133"
---

```
private var _loader:Loader = new Loader( );

_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);

_loader.load(new URLRequest("com/asxp/skin/assets/theme.jpg"));

public function onComplete(event:Event):void{
            var image:Bitmap = Bitmap(_loader.content);
            var bitmap:BitmapData = image.bitmapData;
            image.width=this.stage.stageWidth;
            image.height=this.stage.stageHeight;
            this.addChild(image);
            this.setChildIndex(image,0);
           
       
       
        }
```