0
我得到錯誤的as3corelib系列化出錯
Error #2099: The loading object is not sufficiently loaded to provide this information
,當我嘗試使用的as3corelib編碼對象轉換爲JSON。 我成功地編碼了一些沒有父對象或子對象的值對象,所以我知道這個庫可以工作,並且這個問題可能與addChild或類似的東西有關。這只是猜測。
板被添加到舞臺那樣:
stage.addChild(board);
當我不加板階段,並嘗試對其進行序列化,我得到不同的錯誤:
undefined
at XML/http://adobe.com/AS3/2006/builtin::copy()
at global/describeTraits()
at global/avmplus::describeType()
at global/flash.utils::describeType()
...
板類:
public class Board extends Sprite
{
public var board:Array;
public var blockColor:uint = 0xE3E3E3;
public var blockLength:uint
public function Board(blockLength:uint)
{
super();
x = 0;
y = 0;
this.blockLength = blockLength;
//buttonMode = true;
// Setting up two dim array
board = new Array(10);
for (var k:int = 0; k < board.length; k++)
{
board[k] = new Array(10);
}
for (var i:int = 0; i < 10; ++i)
{
for(var j:int = 0; j < 10; ++j)
{
var block:Block = new Block(i*blockLength, j*blockLength);
board[i][j] = block;
this.addChild(block); // here I add children
block.drawBlock(blockLength, blockColor);
block.addEventListener(MouseEvent.CLICK, blockClicked);
}
}
}
....
}
}
這裏是塊的代碼,真的沒有。
public class Block extends Sprite
{
public var cos:int = 5; // test
public function Block(x:uint, y:uint)
{
...
}
public function drawBlock(length:uint, color:uint):void
{
...
}
}
任何線索爲什麼是這樣?
好的,謝謝你的回答。去實現這一點。 – Marek
工程就像一個魅力,謝謝 – Marek