Flex 4 从画布中删除动态创建的组件
我正在动态地将项目添加到舞台中。然而,我很难解决这些物体将它们从舞台上移走的问题。
我编写了一些代码来执行删除操作,但它仅适用于非动态创建的项目。
http://pastebin.com/3cKvdVsC <= 代码示例(是的,我知道它很混乱,我正在尝试使用我以前从未以反复试验的方式见过的框架)。
我使用“AddItemToCanvas()”创建项目,使用“removeSelected()”从舞台中删除选定的项目。
从理论上讲,必须有一种方法可以通过名称来处理动态创建的项目并将其删除......
请并感谢任何能为我提供帮助的人。
I am dynamically adding items to a stage. How ever I am having a hard time addressing the objects to remove them from the stage.
I wrote some code to do the remove but it only works with non dynamically created items.
http://pastebin.com/3cKvdVsC <= code sample here (yes I know its messy, I was experimenting with a framework I have never seen before in a very trial and error fashion).
I use "AddItemToCanvas()" to create items and "removeSelected()" to remove selected items from the stage.
In thoery there must be a way to address dynamically created items by name and remove them...
Please and thank you to anyone who can shed some light for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案在这里找到了。
http://www.billdwhite.com/wordpress/?p=296
一个无价的这篇文章适合从 Flex 3 迁移到 Flex 4 的任何人。
The answer was found here.
http://www.billdwhite.com/wordpress/?p=296
An invaluable article for anyone moving to Flex 4 from flex 3.