【发布时间】:2014-05-06 00:49:41
【问题描述】:
我正在使用 papervision 并希望在 Cube 的每一侧设置一个 TouchEvent。我该怎么办?现在我正在设置我传递给 MovieMaterial 类的电影剪辑上的事件。 MouseEvent 工作正常,但 TouchEvent 似乎没有触发。
public function MiniCube(k:int, j:int, i:int)
{
var matList:Object = {all:new ColorMaterial(0xff0000,1,true)};
matList.back = createColorMC(0x000000,'back');
matList.front = createColorMC(0x000000,'front');
matList.top = createColorMC(0x000000,'top');
matList.bottom = createColorMC(0x000000,'bottom');
matList.right = createColorMC(0x000000,'right');
matList.left = createColorMC(0x000000,'left');
cube = new Cube(new MaterialsList(matList),10,10,10);
}
private function createColorMC(color:uint, name:String):MovieMaterial
{
var ClassReference:Class = getDefinitionByName(iconArr[Math.floor(Math.random() * iconArr.length)]) as Class;
var mc=new ClassReference();
mc.name = name;
//MOUSE EVENT WORKS
mc.addEventListener(MouseEvent.MOUSE_DOWN, onMovieMatClicked);
//TOUCH EVENT DOESNT
mc.addEventListener(TouchEvent.TOUCH_BEGIN, onMovieMatClicked);
var movieMat:MovieMaterial = new MovieMaterial(mc,true,true);
movieMat.interactive = true;
movieMat.smooth = true;
movieMat.animated = true;
return movieMat;
}
【问题讨论】:
标签: actionscript touch papervision3d