Copy link to clipboard
Copied
Hi
have child animation in Movie Clip on main stage
but can not control it
this.MovClip.stop();
or
this.MovClip.gotoAndPlay();
does not work
I take it that you are doing HTML5 Canvas. If you have a line like this:
this.MovClip.stop();
as the first thing in the first frame that MovClip exists, the script runs before MovClip has appeared. It would simpler to go into MovClip and put:
this.stop();
in its first frame. Or, put the this.MovClip.stop(); into the second frame that it exists in the main timeline.
Copy link to clipboard
Copied
you have a parent moveclip with instance name MovClip? if so and it has a child with instance name c, try:
this.MovClip.c.stop();
if that fails because the code is on the first keyframe that contains MovClip, try
createjs.Ticker.addEventListener('tick',f.bind(this));
function f(){
this.MovClip.c.stop();
createjs.Ticker.removeAllEventListeners('tick');
}
Copy link to clipboard
Copied
Not exactly so
main timeline-MovieClip with instanse name MovClip
inside MovClip another parts of animation
How can to stop MovClip inside animation
I expected that this.MovClip.stop();
will stop timeline playing of MovClip inside animation
Copy link to clipboard
Copied
what do you mean by, "inside MovClip another parts of animation"?
either that animation is on MovClip's timeline or a nested movieclip/graphic on MovClip's timeline. if it's a nested graphic, you can't control it with script. if it's a nested movieclip, you need the path or some other way to access the nested object.
Copy link to clipboard
Copied
I take it that you are doing HTML5 Canvas. If you have a line like this:
this.MovClip.stop();
as the first thing in the first frame that MovClip exists, the script runs before MovClip has appeared. It would simpler to go into MovClip and put:
this.stop();
in its first frame. Or, put the this.MovClip.stop(); into the second frame that it exists in the main timeline.
Copy link to clipboard
Copied
Two Examples
in first tested attempt to stop animation
in second to gotoAndPlay animation
Thanks kglad , Colin Holgate.
"the script runs before MovClip has appeared" if so it makes things more clear.
Copy link to clipboard
Copied
try:
createjs.Ticker.addEventListener('tick',f.bind(this));
function f(){
if(this.MovClip){
this.MovClip.c.stop(); // or do whatever. eg if(this.MovClip.c){this.MovClip.c.stop();}
createjs.Ticker.removeAllEventListeners('tick');
}
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now