Two issues and a question with flash video
- January 1, 2010
- 2 replies
- 496 views
I am trying to create a film module template but have some issue below as well as a question
A video's sound continues to play after navigating to another frame.
My video cue buttons do not play or work after the video has played through one complete time
Is it possible to make a button appear only after a video has played all the way through?
here is some of the code and I have attached the files, thanks for looking
stop();
import flash.events.*;
import fl.video.*;
function cuePointHandler( event:MetadataEvent ):void
{
// On cuePoint, look for a button named with the cue name
// plus "_btn". If it exists, then call its select method...
navigate(event.info.name, false);
}
display.addEventListener(MetadataEvent.CUE_POINT, cuePointHandler);
//-----------------
// Navigation / screen state
//-----------------
// Store the current button name
var currentBtn:*;
var currentBtnName:String = "";
function navigate( cueName:String, seekTo:Boolean ):void
{
// Handle previous button
var prev = getChildByName(currentBtnName);
if( prev != null ){
currentBtn.reset();
}
// Handle new button
var next = getChildByName(cueName+"_btn");
if( next != null ){
currentBtn = next;
currentBtn.select();
currentBtnName = cueName+"_btn";
}
// Seek to Cue Name
if( seekTo == true ){
var c = display.findCuePoint(cueName);
if( c != null ){
display.seekSeconds(c.time);
}
}
}
//-----------------
// Button event handling
//-----------------
// Cue point 1_btn
function cpt1Handler( event:MouseEvent ):void
{
navigate("cpoint1", true);
}
cpt1_btn.addEventListener(MouseEvent.CLICK, cpt1Handler);
// Cue point 2_btn
function cpt2Handler( event:MouseEvent ):void
{
navigate("cpoint2", true);
}
cpt2_btn.addEventListener(MouseEvent.CLICK, cpt2Handler);
// Cue point 3_btn
function cpt3Handler( event:MouseEvent ):void
{
navigate("cpoint3", true);
}
cpt3_btn.addEventListener(MouseEvent.CLICK, cpt3Handler);
// Cue point 4_btn
function cpt4Handler( event:MouseEvent ):void
{
navigate("cpoint4", true);
}
cpt4_btn.addEventListener(MouseEvent.CLICK,cpt4Handler);
// Cue point 5_btn
function cpt5Handler( event:MouseEvent ):void
{
navigate("cpoint5", true);
}
cpt5_btn.addEventListener(MouseEvent.CLICK, cpt5Handler);