您的位置:首页 > 运维架构 > Linux

centos 删除旧内核

2015-11-26 10:41 477 查看
使用一个Loaderload资源时报错误

Title
所提供的DisplayObject 必须为
调用方的子级
的解决方案

Title
package com.asdia.comptest

{

 import flash.display.Bitmap;

 import flash.display.Loader;

 import flash.display.Sprite;

 import flash.events.Event;

 import flash.net.URLRequest;

 import flash.system.System;

 public class DisplayTesting extends Sprite

 {

  public var text:String ;

  private static var _loader:Loader= null;

  public function DisplayTesting()

  {

  

  }

  public function LoadImg():void{

   //_loader=new Loader();

   _loader=getLoaderIntance();

   _loader.contentLoaderInfo.addEventListener(Event.COMPLETE,showImg)

   if(_loader.content!=null){

    

    _loader.removeEventListener(Event.COMPLETE,showImg);

    _loader=null;

    _loader=getLoaderIntance();

   }

   

   _loader.contentLoaderInfo.addEventListener(Event.COMPLETE,showImg)

   _loader.load(new URLRequest("http://images.sohu.com/uiue/sohu_logo/beijing2008/2008sohu.gif"));

  }

  static public function  getLoaderIntance():Loader{

   if(_loader==null){

    _loader=new Loader();

    return _loader;

   }else{

    return _loader;

   }

  }

  private function showImg(event:Event):void{

   var image:Bitmap=_loader.contentLoaderInfo.content as Bitmap;

   

   this.addChild(image);

   trace(System.totalMemory);

  }

  

 }

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: