mardi 23 février 2016

Trying to add an event listener for PLAYING/PAUSED_STATE_ENTERED, returning error 1119

Basically I have a very simple video gallery set up. I want it so that when the video is paused some buttons will become visible on the screen and when it is playing these buttons will not be visible. This is my code:

import fl.video.*;
import fl.video.VideoEvent;
import flash.events.Event;

videoOne.addEventListener(Event.PLAYING_STATE_ENTERED, hideInfo());
videoOne.addEventListener(Event.PAUSED_STATE_ENTERED, showInfo());

function showInfo() {
    thumbnailOne.visible = true;
    thumbnailTwo.visible = true;
    thumbnailThree.visible = true;
    videoGalleryInfo.visible = true;
    infoHidden = 0;
}

function hideInfo() {
    thumbnailOne.visible = false;
    thumbnailTwo.visible = false;
    thumbnailThree.visible = false;
    videoGalleryInfo.visible = false;
    infoHidden = 1;
}

I have tried using Event instead of VideoEvent and so on as this fixed an issue with adding another event listener earlier on for the COMPLETE event, but I'm always returned with

Video gallery, Layer 'ActionScript', Frame 77, Line 22  1119: Access of possibly undefined property PLAYING_STATE_ENTERED through a reference with static type Class.

Video gallery, Layer 'ActionScript', Frame 77, Line 23  1119: Access of possibly undefined property PAUSED_STATE_ENTERED through a reference with static type Class.

I do not understand what I'm doing wrong. Shouldn't the properties be defined through importing fl.video.*; and flash.events.Event;?

Aucun commentaire:

Enregistrer un commentaire