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);
}
}
}
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);
}
}
}
相关文章推荐
- linux df du 查看文件和文件夹大小
- win下创建的.sh文件,在linux执行报错问题
- LINUX 安全运维 (二)
- [Linux]后台运行进程的方法
- Linux下无法清空回收站
- linux rm文件恢复总结
- CentOS学习9_CentOS安装系统时硬盘分区建议
- 【学神-RHEL7】1-3-Linux基本命令和配置服务器来电后自动开机
- 图示-Centos7完整安装
- 修改 linux 默认启动级别 设置系统时间 定时关机
- Linux上安装SVN Server 服务器的方法
- linux 常用命令
- 修改 linux 默认启动级别 设置系统时间 定时关机
- Windows 和 Linux 下 禁止ping的方法
- 修改 linux 默认启动级别 设置系统时间 定时关机
- 修改
- Windows2008下搭建NFS实现windows空间提供linux使用
- LINUX 安全运维 (一)
- linux 常用命令
- Windows中的.Net服务移植到Centos