[英]Flash QuickBox2d skinMc.gotoAndPlay(1);
I have this quickBox2d code to add a cricle to the stage: 我有这个quickBox2d代码可以在舞台上添加一个cricle:
var ball:QuickObject = sim.addCircle( {skin:skinMc, x:10, y:10, radius:3, density:0 } );
The skinMc contains animations so I want to be able to refer to it like this: skinMc.gotoAndPlay(5); skinMc包含动画,因此我希望能够像这样引用它:skinMc.gotoAndPlay(5); but it says 但它说
Type Coercion failed: cannot convert skinMc$ to flash.display.MovieClip. 类型强制转换失败:无法将skinMc $转换为flash.display.MovieClip。
ball.gotoAndPlay(5); ball.gotoAndPlay(5); doesn't work either since it's a QuickObject, not an mc... 也不起作用,因为它是QuickObject,而不是mc ...
Any help will be appreciated 任何帮助将不胜感激
Thanks 谢谢
ball.userData.gotoAndPlay(5);
userData将是由QuickBox2D填充的DisplayObject。
var sim:QuickBox2D = new QuickBox2D
var ball:QuickObject = sim.addCircle( {skin:skinMc, x:10, y:10, radius:3, density:0 } );
//something along these lines
So to reference the object you can use: 因此,可以使用以下对象来引用该对象:
sim.gotoAndPlay("5");
im not 100% on what your doin but i installed both packages and created a quick document and it works fine on my machine. 即时消息不是100%关于您的工作,但是我安装了这两个软件包并创建了一个快速文档,并且在我的机器上工作正常。 if need be try this link http://www.emanueleferonato.com/2009/08/25/simplify-your-box2d-projects-with-quickbox2d/ 如果需要,请尝试此链接http://www.emanueleferonato.com/2009/08/25/simplify-your-box2d-projects-with-quickbox2d/
if this fails,send me your file or else let me know how you go. 如果失败,请向我发送您的文件,否则请告诉我您的情况。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.