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

推荐订阅源

博客园_首页
T
Threat Research - Cisco Blogs
GbyAI
GbyAI
Y
Y Combinator Blog
美团技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
S
SegmentFault 最新的问题
IT之家
IT之家
Recent Announcements
Recent Announcements
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
阮一峰的网络日志
阮一峰的网络日志
T
The Blog of Author Tim Ferriss
Martin Fowler
Martin Fowler
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
WordPress大学
WordPress大学
博客园 - Franky
L
LangChain Blog
人人都是产品经理
人人都是产品经理
小众软件
小众软件
博客园 - 叶小钗
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
雷峰网
雷峰网
腾讯CDC
Google DeepMind News
Google DeepMind News
博客园 - 三生石上(FineUI控件)
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Help Net Security
Help Net Security
C
Check Point Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
News and Events Feed by Topic
V2EX - 技术
V2EX - 技术
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Schneier on Security
Schneier on Security
博客园 - 聂微东
A
Arctic Wolf
H
Heimdal Security Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Recent Commits to openclaw:main
Recent Commits to openclaw:main
T
The Exploit Database - CXSecurity.com
C
Cyber Attacks, Cyber Crime and Cyber Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Google DeepMind News
Google DeepMind News

博客园 - netlynx2000

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

现在一直在用flex,积攒了一些经验和不少代码,开始写写。

    在Flex的帮助文档里,有很多例子都是扩展Sprite类的。如果想把这些实例添加到你的mx:Application中,如:addChild(DisplayObject ),肯定会出错。错误的大致意思是:flash.display::Sprite没有实现mx.core.IUIComponent接口。

   

Sprite->DisplayObjectContainer ->InteractiveObject ->DisplayObject ->EventDispatcher ->Object

从Sprite的继承关系来看,它虽然是DIsplayObject但是它没有实现IUIComponent,不能直接添加到Flex组件里是当然的了。

    Flex文档上指出所有的可视化控件都继承自UIComponent 而它自己是实现了IUIComponent 接口的。UIComponent 允许添加Sprite和MovieClip。

经常使用到的做法是:

   var comp: UIComponent = new UIComponent();
   comp.addChild(sprite);
   cavas1.addChild(comp);

这样flash控件就能正常在flex组件里显示了。

Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1534649