2011-12-19 60 views
0

我正在使用QuickBox2D庫,並且正在嘗試將一個對象移動到舞臺的底部。AS3:SetChildIndex不起作用

但它不起作用,QuickBox2D似乎沒有認出它。

Call to a possibly undefined method setChildIndex through a reference with static type com.actionsnippet.qbox:QuickBox2D. 

對象:

 var gameBall:QuickObject; 

ChildIndex

 sim.setChildIndex(gameBall, 0); 

回答

2

QuickBox2D類從EventDispatcher繼承,其中setChildIndex定義不DisplayObjectContainer。我沒有看到在QuickBox2D系統中處理z-indicies的方法,這對我來說實際上是有意義的,因爲對象不應該在物理系統中重疊。

0

讓我們來看看setChildIndex()

  • 這是由DisplayObjectContainer定義的方法。
  • 它的第一個參數必須是DisplayObject。從QuickBox2D一個實例(不是DisplayObjectContainer

    1. 呼叫setChildIndex()

目前,你想。

  • 通過QuickBox2D的另一個實例作爲第一個agument(它需要是DisplayObject)。