我保存了一个位图,我想在运行时加载它。
这是我的代码:
var saveDataTxt:SharedObject = SharedObject.getLocal("文件");
var 文本名称:字符串;var textClass:类;
文本名称=“文本0”+ 1;textClass = getDefinitionByName(textName) as Class;
var tx:BitmapData = new textClass(); txtP[1] = 新位图(tx);saveDataTxt.data.txtArray[1] = txtP[1];
addChild(saveDataTxt.data.txtArray[n]);
但它给了我一个错误:
**TypeError: Error #1034: Type Coercion failed: cannot convert Object@384c2b1 to flash.display.DisplayObject.**
解决方案是什么?