I'm working on a CD project using Flash 8 (projector) and AS2.0 to load
multiple FLV files dynamically from the CD. There are 6 FLVs and the functions
that call each movie is located on 6 keyframes. On each keyframe, I've put this
code:
--------------------------------------------------------------------------------
------
action script is attached at the end of this post.
--------------------------------------------------------------------------------
------
'flvPlayback' is the instance name of my FLVPlayback component. I'm using the
same name for all six FLVPlayback instances. Each instance is on a different
frame and never overlaps each other. All the six keyframes contain the same
actions except for the first line of scripts that loads a different movie. I
also have six navigation buttons that simply move the playhead to these frame
labels when clicked.
PROBLEM: Whereever I am on the CD menu, it seems every second button that I
click, loads the FLV correctly but does not display the video. Strangely, I can
hear the audio from the video just fine. So if I'm on frame label 3, and I
click button 2 (to go to frame label 2) it loads the second FLV without visual.
The problem only occurs when 'moving backward' through the main timeline. So if
I'm on frame label 3, and I click button 1, the FLV loads just fine. Then when
I move forward by clicking button 2 (to go to label 2) the movie also displays
fine.
Is this a bug within Flash or is there something wrong with my ActionScript?
Your help will be much appreciated!
Thank you.
stop();
flvPlayback.contentPath = "videos/01_intro.flv";
function seekToCuePoint(cueName):Void {
var c = flvPlayback.findCuePoint(cueName);
flvPlayback.seekSeconds(c.time);
}
function synchVideoToInterace(cueName:String) {
if (!flvPlayback.playing) {
flvPlayback.play();
}
_root.slides.gotoAndStop(cueName);
}
var videoEventHandler:Object = new Object();
videoEventHandler.cuePoint = function(evt:Object):Void {
synchVideoToInterace(evt.info.name);
};
videoEventHandler.rewind=function (evt:Object):Void {
var nearestCue = evt.target.findNearestCuePoint(evt.playheadTime);
synchVideoToInterace(nearestCue.name);
};
flvPlayback.addEventListener("rewind", videoEventHandler);
flvPlayback.addEventListener("cuePoint", videoEventHandler);[