Hi,
I have a series of LoaderMax videos playing and the VIDEO_CUE_POINT events are working fine but for some reason the VIDEO_COMPLETE and BUFFER_EMPTY events do not seem to be firing. Could you offer any advice given the example below? I've checked many times and can't see an error with my code.
I've cut out the main stuff. I can post more if anything else is needed.
Thank you.
import com.greensock.*;
// example of 2 queues of which the loaders below are attached to
var VideoQueue:LoaderMax = new LoaderMax({name:"VideoQueue", onProgress:progressHandler, onComplete:completeHandler, onChildComplete:_childCompleteHandler, onError:errorHandler, maxConnections:3});
var VideoQueue1:LoaderMax = new LoaderMax({name:"VideoQueue1", onProgress:progressHandler, onComplete:completeHandler, onChildComplete:_childCompleteHandler, onError:errorHandler, maxConnections:2}); // example of 2 queues
// all the below are added at the same time at the beginning of the first video.
// is this adding too many at one time?
s_intro.addEventListener(VideoLoader.VIDEO_CUE_POINT, cuePointHandler); // working fine
s_1a.addEventListener(VideoLoader.VIDEO_CUE_POINT, cuePointHandler); // working fine
s_1b.addEventListener(VideoLoader.VIDEO_CUE_POINT, cuePointHandler); // working fine
s_intro.addEventListener(VideoLoader.VIDEO_BUFFER_EMPTY, _videoBufferEmpty); // this is an example of my BufferEmpty Listeners which aren't working.
s_intro.addEventListener(VideoLoader.VIDEO_COMPLETE, s_intro_end);
s_1a.addEventListener(VideoLoader.VIDEO_COMPLETE, s_1_end);
s_1b.addEventListener(VideoLoader.VIDEO_COMPLETE, s_1_end);
s_2a.addEventListener(VideoLoader.VIDEO_COMPLETE, s_2_end);
s_2b.addEventListener(VideoLoader.VIDEO_COMPLETE, s_2_end);
s_3a.addEventListener(VideoLoader.VIDEO_COMPLETE, s_3_end);
s_3b.addEventListener(VideoLoader.VIDEO_COMPLETE, s_3_end);
// Below is an example of the VIDEO_COMPLETE functions that are not receiving anything whatsoever without any errors.
function s_intro_end(event:LoaderEvent):void {
trace("End of INTRO") //
if (decision_A == false) {
showVideo(s_1a);
trace("playing Option A");
} else if (decision_A == true) {
showVideo(s_1b);
trace("playing Option B");
}
}
// And Finally the Buffer Empty function that also isnt working:
function _videoBufferEmpty(event:LoaderEvent):void {
trace("Buffer Empty");
trace(event.data);
MonsterDebugger.trace(this, "Buffer Empty");
if (videoStarted == true) {
_currentVideo.addEventListener(VideoLoader.VIDEO_BUFFER_FULL, bufferingFull);
_currentVideo.addEventListener(LoaderEvent.PROGRESS, bufferingProgress);
addChild(bufferScreen);// tween in
TweenMax.to(bufferScreen, 0.2, {alpha:1});
addChild(progressbarBuffer);
TweenMax.to(progressbarBuffer, 0.3, {alpha:1});
MonsterDebugger.trace(this, "add Buffer and Progress Listener | add bufferScreen");
}
}
Have I done anything wrong here?