Copy link to clipboard
Copied
Hi, I'm tearing my hair out trying to add controls such as pause and volume to my Chromeless Youtube Player in Flash with actionscript 3, tried working with the reference that google provide but it still doesn't work. Here's what I tried, can anyone tell me where I'm going wrong?
function pauseVideo() {
if (player) {
player.pauseVideo();
}
}
pauseBtn.addEventListener(MouseEvent.CLICK,pauseVideo);
Thanks
You must have compiler error - code shouldn't compile. Event handler expects one argument - Event.
So, correct code would be:
function pauseVideo(e:MouseEvent):void
{
if (player)
{
player.pauseVideo();
}
}
pauseBtn.addEventListener(MouseEvent.CLICK, pauseVideo);
Copy link to clipboard
Copied
You must have compiler error - code shouldn't compile. Event handler expects one argument - Event.
So, correct code would be:
function pauseVideo(e:MouseEvent):void
{
if (player)
{
player.pauseVideo();
}
}
pauseBtn.addEventListener(MouseEvent.CLICK, pauseVideo);
Copy link to clipboard
Copied
Thank you! Greatly appreciated
Find more inspiration, events, and resources on the new Adobe Community
Explore Now