Skip to main content
Participating Frequently
May 13, 2017
Answered

HMTL5 Video Event Listener

  • May 13, 2017
  • 1 reply
  • 430 views

Hi, I'm new to scripting in AS3 so I apologise if I'm just doing something really stupid...

I'm having trouble getting any video event listeners to work.

I want to use html5 to load a video and do something (go to a specific frame etc) when it ends.

I've looked for examples, but haven't got any to work, lots seem to be written for Edge, but I can't get any to work.

Failing this, can anyone explain why my video in an AIR file looks pixelated? Only choosing html5 as the video looks better.

Thanks, Dan.

PS: I'm using the 2017.2 version of Animate.

This topic has been closed for replies.
Correct answer ClayUUID

Yeah, javascript... I meant to say I haven't touched Actions since AS2 - a loooooooong time ago.


You were probably trying to address the component before it had initialized. Timeline code executes first, then any clips/components after that. Usually waiting one frame allows everything to fully initialize.

1 reply

Participating Frequently
May 15, 2017

It seems that I was trying to do everything too quick.

If I leave the adding of an event listener until frame 5, it works.

I think it was trying to add the event listener before (or at the same time as) it was trying to actually make the html5 video item.

There's probably a preload setting I should be using, but for now this workaround is doing the trick.

If somebody knows how to do this properly, I'd be grateful to hear how.

Legend
May 15, 2017

How on Earth are you using HTML5 video in an AS3 document?

Participating Frequently
May 15, 2017

Yeah, javascript... I meant to say I haven't touched Actions since AS2 - a loooooooong time ago.