我正在开发一个原型,在该原型中我将纹理添加到movieClip。这是我的代码:
[Embed(source = "/../assets/demo_img.png")]
protected var asset01:Class;
[Embed(source="/../assets/demo_img.xml",mimeType="application/octet-stream")]
protected var data01:Class;
我的电影剪辑代码是:
var myTexture:Texture = Texture.fromBitmap(new asset01());
var atlas:TextureAtlas = new TextureAtlas(myTexture, XML(new data01()));
var mc:MovieClip = new MovieClip(atlas.getTextures("demo_img_"), 10);
但它给了我错误:
Error: exception during transcoding: Failed to grab pixels for image \..\PP143Starling\assets\demo_img.png
如果有人对此有任何想法,请分享。