Link to home
Start Free TrialLog in
Avatar of Fern2
Fern2Flag for Iceland

asked on

When video/flv ends do gotoAndPlay(xxx)

Hi

I have a project and in the project the user clicks a button with the action:"gotoAndPlay(50)" where a FLV file is played.

My problem is that when the flv file  ends I need to do the action:"gotoAndPlay(1)"

How can I do this?
Avatar of Dushan Silva
Dushan Silva
Flag of Australia image

Avatar of Fern2

ASKER

I put this into the frame script

var myPlayerListener:Object = new Object();
myPlayerListener.change = function(eventObj:Object) {
    var myPosition:Number = myPlayer.playheadTime;
    var myPercentPosition:Number = (myPosition/myPlayer.totalTime);
    if (myPercentPosition > 90) // When 90% of the video is done start loading another movie
    {
       trace("Done");
    }
};
myPlayer.addEventListener("change", myPlayerListener);


name the flv file "myPlayer" in the properies of the flv file.


The script doesnt work. What am I doing wrong?
ASKER CERTIFIED SOLUTION
Avatar of Aneesh Chopra
Aneesh Chopra
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Fern2

ASKER

thx again you are a true wizard of flash.

bytheway...is that you in the video :)
thanx for the appreciation

no.. not me.. :)