I have found this on the net and been trying to get this to work but its not happening, anyone any ideas why?
import fl.video.*;
import fl.controls.ProgressBarMode;
import fl.transitions.*;
import fl.transitions.easing.*;
// Set Variables
var flvControl = display;
var flvSource = "mymovie.mov";
display.bufferTime = 30;
//fade the mcBufferingIndicator when buffered.
function onPlayerBuffered(event:VideoEvent)
{
TransitionManager.start(mcBufferingIndicator, {type:Fade, direction:Transition.OUT, duration:0.5, easing:Strong.easeOut});
}
display.addEventListener(VideoEvent.PLAYING_STATE_ ENTERED, onPlayerBuffered);
//Display the mcBufferingIndicator when buffering.
function onPlayerNotBuffered(event:VideoEvent)
{
mcBufferingIndicator.visible = true;
}
display.addEventListener(VideoEvent.BUFFERING_STAT E_ENTERED, onPlayerNotBuffered);
// Create event handler functions to control the progressbar
function progressHandler(event:VideoProgressEvent):void
{
var bl = Math.round(event.bytesLoaded/1000);
var bt = Math.round(event.bytesTotal/1000);
// Update progress...
pb.setProgress(bl,bt);
}
function readyHandler(event:VideoEvent):void
{
// Remove progressbar when we start playing...
removeChild(pb);
}
// Set progress bar state
pb.mode = ProgressBarMode.MANUAL;
pb.indeterminate = false;
// Add listeners and load the video
flvControl.addEventListener(VideoProgressEvent.PRO GRESS, progressHandler);
flvControl.addEventListener(VideoEvent.READY, readyHandler);
flvControl.source = flvSource;
-
- import fl.video.*;
- import fl.controls.ProgressBarMode;
- import fl.transitions.*;
- import fl.transitions.easing.*;
- // Set Variables
-
- var flvControl = display;
- var flvSource = "mymovie.mov";
-
- display.bufferTime = 30;
-
-
- //fade the mcBufferingIndicator when buffered.
- function onPlayerBuffered(event:VideoEvent)
- {
-
- TransitionManager.start(mcBufferingIndicator, {type:Fade, direction:Transition.OUT, duration:0.5, easing:Strong.easeOut});
- }
-
- display.addEventListener(VideoEvent.PLAYING_STATE_ ENTERED, onPlayerBuffered);
-
- //Display the mcBufferingIndicator when buffering.
- function onPlayerNotBuffered(event:VideoEvent)
- {
- mcBufferingIndicator.visible = true;
- }
- display.addEventListener(VideoEvent.BUFFERING_STAT E_ENTERED, onPlayerNotBuffered);
-
- // Create event handler functions to control the progressbar
- function progressHandler(event:VideoProgressEvent):void
- {
- var bl = Math.round(event.bytesLoaded/1000);
- var bt = Math.round(event.bytesTotal/1000);
-
- // Update progress...
- pb.setProgress(bl,bt);
- }
-
- function readyHandler(event:VideoEvent):void
- {
- // Remove progressbar when we start playing...
- removeChild(pb);
- }
-
- // Set progress bar state
- pb.mode = ProgressBarMode.MANUAL;
- pb.indeterminate = false;
-
- // Add listeners and load the video
- flvControl.addEventListener(VideoProgressEvent.PRO GRESS, progressHandler);
- flvControl.addEventListener(VideoEvent.READY, readyHandler);
- flvControl.source = flvSource;
-
I am getting the following errors:
The class or interface 'VideoEvent' could not be loaded.
Source: function onPlayerBuffered(event:VideoEvent)
The class or interface 'VideoEvent' could not be loaded.
Source: function onPlayerNotBuffered(event:VideoEvent)
The class or interface 'VideoProgressEvent' could not be loaded.
Source: function progressHandler(event:VideoProgressEvent):void
The class or interface 'VideoEvent' could not be loaded.
Source: function readyHandler(event:VideoEvent):void
Any help appreciated
Moderator Remark: Use [code][/code] to encapsulate code segments