在Flex中显示actionscript的显示对象

  最近几天在做flex图片浏览的程序,发现在flex中显示actionscript声明的actionscript显示对象(比如:new Sprite(),new Bitmap() 等等),总是不成功,后来通过google得知,要在flex中显示actionscript中的对象,要封装一下,比如要在flex中显示sprite,要用一下方法:

要显示Sprite可以使用UIComponent包装一下,例如

var comp: UIComponent = new UIComponent();
comp.addChild(Sprite对象);
HBox.addChild(comp);


如果Sprite包含其它Sprite,只需要包装最顶级的Sprite

参考: http://wangcheng.iteye.com/blog/129027

你可能感兴趣的:(Flex,Blog,Google,actionscript)