Skip to main content
Known Participant
February 16, 2017
Answered

Have a problem with child movie clip control

  • February 16, 2017
  • 3 replies
  • 1020 views

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

    This topic has been closed for replies.
    Correct answer Colin Holgate

    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.

    3 replies

    Known Participant
    February 18, 2017

    Two Examples

    in first tested attempt to stop animation

    in second  to gotoAndPlay animation

    Yandex.Disk

    Thanks kglad , Colin Holgate.

    "the script runs before MovClip has appeared" if so it makes things more clear.

    kglad
    Community Expert
    February 18, 2017

    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');

    }

    }

    Colin Holgate
    Colin HolgateCorrect answer
    Inspiring
    February 17, 2017

    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.

    kglad
    Community Expert
    February 16, 2017

    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');

    }

    Known Participant
    February 17, 2017

    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

    kglad
    Community Expert
    February 17, 2017

    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.