Skip to main content
Inspiring
May 1, 2025
Answered

Can't get a movie clip to play

  • May 1, 2025
  • 1 reply
  • 225 views

I am making an HTML5 canvas game. I have a frog movie clip and an arrow movie clip (called arrows_0_10). Both have animations on their timelines. When the frog clip reaches a certain frame of its timeline, I want it to start the arrow clip's animation. I have used the code, 'this.parent.arrows_0_10.play()' but this does not work. I've also tried 'gotoAndPlay(0)' instead of 'play()'. When I try 'alert(this.parent.arrows_0_10.visible)' it returns 'true', so it must be finding the clip. When I put a test button on the same timeline as the arrow clip and use 'this.arrows_0_10.play()', the clip plays.

There are no errors, so what am I doing wrong?

Correct answer pauls73381349

When the playhead reaches a particular frame on the frog timeline, it runs some code - part of which is the instruction to play(). I've actually changed the setup now so that it doesn't require playing - just stopping - and that seems to work ok. If there's an obvious reason why it wasn't playing, though, I'd be interested to know what it is. Thanks.

1 reply

kglad
Community Expert
Community Expert
May 1, 2025

what triggers that play() method?

pauls73381349AuthorCorrect answer
Inspiring
May 1, 2025

When the playhead reaches a particular frame on the frog timeline, it runs some code - part of which is the instruction to play(). I've actually changed the setup now so that it doesn't require playing - just stopping - and that seems to work ok. If there's an obvious reason why it wasn't playing, though, I'd be interested to know what it is. Thanks.

kglad
Community Expert
Community Expert
May 1, 2025

there's no reason to debug something that doesn't exist any more.