Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Have a problem with child movie clip control

Explorer ,
Feb 16, 2017 Feb 16, 2017

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

967
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Feb 17, 2017 Feb 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.

Translate
Community Expert ,
Feb 16, 2017 Feb 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');

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 16, 2017 Feb 16, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 17, 2017 Feb 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 17, 2017 Feb 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 17, 2017 Feb 17, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 18, 2017 Feb 18, 2017
LATEST

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

}

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines