惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
Kaspersky official blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
Netflix TechBlog - Medium
腾讯CDC
IT之家
IT之家
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
罗磊的独立博客
P
Privacy International News Feed
D
DataBreaches.Net
T
Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
S
Securelist
P
Palo Alto Networks Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Secure Thoughts
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LangChain Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Troy Hunt's Blog
The Last Watchdog
The Last Watchdog
T
Tor Project blog
V
Vulnerabilities – Threatpost
T
Threat Research - Cisco Blogs
H
Heimdal Security Blog
Hugging Face - Blog
Hugging Face - Blog
Hacker News: Ask HN
Hacker News: Ask HN
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
S
SegmentFault 最新的问题
Know Your Adversary
Know Your Adversary
博客园_首页
N
News and Events Feed by Topic
G
GRAHAM CLULEY
L
LINUX DO - 热门话题
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Help Net Security
Help Net Security
Simon Willison's Weblog
Simon Willison's Weblog
H
Hacker News: Front Page
大猫的无限游戏
大猫的无限游戏
AWS News Blog
AWS News Blog
The Cloudflare Blog
AI
AI

博客园 - netlynx2000

flex如何删除一个XML Node flex TabContainer 类实例化问题 一个追风筝的人,追寻着什么 flex加载Module遇到的问题 Action script如何复制一个Bitmap对象 Flex- 将Sprite控件添加到FLEX UI中 ex metadata tag 自定义flex中的事件 从EAI到SOA OMG工作流规范翻译 男人,信仰,爱,恨,人性 开源产品公司如何生存 拔拔草,开源与闭源 其实现在的我们也有很多梦想,比如低谷时想未来做一个什么样的公司,未来买什么样的豪宅。但是仅限于自我满足的想想,然后继续平庸的生活。 做事情的好习惯 使用Ajax读取aspx页面源代码 挣钱,买个照相机 友情提示的一个问题 苍天开眼,刘青云终于获奖了
如何一个Loader加载多个资源
netlynx2000 · 2008-03-06 · via 博客园 - netlynx2000

使用一个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);
  }
  
 }

}

posted on 2008-03-06 11:09  netlynx2000  阅读(409)  评论()    收藏  举报