CreateJS play a child movieclip

2019-09-12 02:10发布

问题:

If you have a child movieclip on stage with an animation in it, can you have the main timeline play the child movieclip at a certain timeline?

mc_child is a 20 frame animation with this.stop() at frame one so that it is paused at the beginning.

If you add the code this.mc_child.play() or this.mc_child.gotoAndPlay(5) you get an error in createJS. "Uncaught TypeError: Cannot read property 'play' of undefined."

How do you make child movieclips play at a certain frame?

回答1:

You can use gotoAndPlay(5);

Have a look at the EaselJS documentation: http://www.createjs.com/docs/easeljs/classes/MovieClip.html