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

Animate CC HTML5/Canvas how to control a nested MovieClip timeline

Community Beginner ,
Apr 08, 2017 Apr 08, 2017

Hi,

I have a problem i can't seem to wrap my head around.

I created a Movieclip with several frames and on each frame is another nested movieclip and ocasionally that also contains other movieclips (all with instance names while the mainMc is added via addChild() to the stage).

so "mainMc > subMc > subSubMc"

Now i try to control the timeline of the subMc, respectively the subSubMc

I figuered it would be easy as

mainMc.stop(); or

mainMc.gotoAndStop('label');

works like a charm.

If i try to control the timeline like

mainMc.subMc.stop(); or any timeline command absolutely nothing happens. the MC keeps looping (stage.update(); is ticking);

The console doesn't throw any errors and it works absolutely fine if i try to do any other operations o a nested mc - line alpha, rotation, coordinates etc.

Why the heck can't i control the timeline?

Help please? Anyone?

7.0K
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

Community Beginner , Apr 11, 2017 Apr 11, 2017

Man, so much helpful people!

To set things right the actually is an even simpler solution thanks to this guy Animate CC HTML5/Canvas controling a nested MovieClip timeline with actionscript - Stack Overflow

It seems to be an animate cc bug! You have to set the mainMc to gotoAndStop(0); first! Do not make the mistake of thinking stop(); would work here - as i did!

Translate
LEGEND ,
Apr 10, 2017 Apr 10, 2017

Are you trying to issue these commands on the very first frame the nested clips exist? Because that's likely not going to work. Animate instantiates clips top-down, so the top level code will be trying to issue commands to clips that don't exist yet. If you want a movie clip to reliably start stopped, you have to put a this.stop(); in its first frame.

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 Beginner ,
Apr 10, 2017 Apr 10, 2017

Thank you for your reply.

Technically yes, I put the whole code on the first frame of my project.

What i don't get is why I can change all other properties without any problem.

If I put the stop-command directly in the nested movieclip it works without a problem. But then I still can't use the start or gotoAnd... commands. As I stated it works totally finde with movieclip-instaces i add via addChild to the stage - even in the first frame ... just nested movieclips won't respond.

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 ,
Apr 10, 2017 Apr 10, 2017

You can change properties because controlling a clip's timeline is handled differently internally than just setting a property.

It works fine with addChild because that command fully instantiates the clip before control is returned to the calling code.

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 Beginner ,
Apr 10, 2017 Apr 10, 2017

Your input is much welcomed

Is there any possibilty to reinstatiate the nested clips so the timeline works? I need to use the gotoAndStop() command a lot and it would be so much easier if I could control the timeline without creating Containers and adding/removing every single instance when needed ...

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 ,
Apr 10, 2017 Apr 10, 2017

I have no idea what "reinstatiate" is supposed to mean.

You can control nested clips without issue by just waiting until the frame after they first appear. If that would cause visual issues, you can have them start hidden or off-stage.

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 Beginner ,
Apr 11, 2017 Apr 11, 2017

hmm,

well I thought it might be possible to somehow tell the nested mc to recognise the timeline properties as addChild seems to do the trick for the main mc. But maybe I don't get how things work^^

I really appreciate you taking time to try an solve my problem. The thing with your solution is that i don't have frames. I just use the IDE to build my assets. Everything else is assembled in javascript by taking the assets from the library and using addChild. So there is no second frame. Even if I add an update.stage() directly after placing the main mc it is still impossible to control the timeline of the sub mcs. I'm at a total loss here. Funny thing is that nowhere is an answer to my question. I can't believe I'm the first to try this stuff^^

well, i guess i somehow have to rely on another way to achive what i want

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 Beginner ,
Apr 11, 2017 Apr 11, 2017

Heureka! I found the solution, thanks to this post javascript - HTML5 Canvas / Flash. How to access children movie clip and make it gotoAndPlay? - Stac...

You can manipulate nested mcs on events! so if you use for example

mainMc.on('tick',function(){ this.subMc.gotoAndStop(1);} );

it actually works - I'll be damned.

ClayUUID - Thanks you for your time but this sollution was exaactly what I needet, at least it works for the time being

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 Beginner ,
Apr 11, 2017 Apr 11, 2017

Man, so much helpful people!

To set things right the actually is an even simpler solution thanks to this guy Animate CC HTML5/Canvas controling a nested MovieClip timeline with actionscript - Stack Overflow

It seems to be an animate cc bug! You have to set the mainMc to gotoAndStop(0); first! Do not make the mistake of thinking stop(); would work here - as i did!

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 ,
Apr 11, 2017 Apr 11, 2017
LATEST

Yes, ticks and frames are synonymous spans of time in Canvas.

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