Adobe Flash CS6 - FLVPlayback Start From Time

133 Views Asked by At

I'm working with Adobe Flash CS6 with Action Script 3.0

This is what I have:

This is just a simple explanation of my project. I have 2 pages (frames) in my project: Scene Selection and Watch Video.

On Watch Video, I have a video which play automatically. This video consists of 3 parts: Part 1, Part 2, and Part 3. I also have button Home to go back to Scene Selection.

On Scene Selection, I have 3 images which act as buttons: Part 1, Part 2, and Part 3. If I click button Part 2, I will be directed to Watch Video page, and the video will be skipped to Part 2.

This is the code:

//Scene Selection
btnPart1.addEventListener(MouseEvent.CLICK, OnClickPart1);
function OnClickPart1(event:MouseEvent):void
{
    //I think something is missing here
    gotoAndStop(3);
}


//Watch Video
import fl.video.FLVPlayback;
import fl.video.VideoPlayer;
import flash.events.Event;

var flvPlayer:FLVPlayback = new FLVPlayback();
var vp:VideoPlayer = flvPlayer.getVideoPlayer(0);

addChild(flvPlayer);
flvPlayer.x = 162.5;
flvPlayer.y = 100;
flvPlayer.width = 1024;
flvPlayer.height = 576;
flvPlayer.source = "Final.mp4";
flvPlayer.skin = "SkinOverPlaySeekMute.swf"
flvPlayer.skinBackgroundColor = 0xF9D760;

btnHome.addEventListener(MouseEvent.CLICK, OnClickHome);
function OnClickHome(event:MouseEvent):void
{
    gotoAndStop(1);
    CleanFlvPlayer();
}
function CleanFlvPlayer():void{
    vp.close();
    removeChild(flvPlayer);
}

This is the question:

I don't have problem with Part 1, because it works just like I want. But, how can I skipped the video to a certain time? I can't separate the video into each part, because my real project is more complicated than this. What code should I add? Thanks.

0

There are 0 best solutions below