我正在尝试制作一个水粒子相互碰撞的水系统,但我不断收到此错误。
[object water]
TypeError: Error #1010: A term is undefined and has no properties.
at science_fla::MainTimeline/feed()
这是代码:
import flash.events.MouseEvent;
import com.coreyoneil.collision.CollisionList;
//etc
stop();
stage.addEventListener(MouseEvent.CLICK,feed);
function feed(event:MouseEvent)
{
var wat:water = new water(event.target.mouseX,event.target.mouseY);
MovieClip(root).addChild(wat);
particles.push(wat);
for(var i = 0; i < particles.length;i++)
{
if (particles[i]!=wat)
{
trace(particles[i]);
wat.myCollision.addItem(particles[i]);
}
particles.myCollision.addItem(wat);
}
}
感谢您所有的帮助。如果您需要更多代码,请询问。