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?
LVL 1
Fern2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dushan De SilvaTechnology ArchitectCommented:
0
Fern2Author Commented:
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?
0
Aneesh ChopraCommented:
Hi,

Here I have done a SAMPLE FLA exclusively for you
download it here.
http://s5.yousendit.com/d.aspx?id=12VUGO1LPUS1D1J88AEP89O7AM

for others reference
I haveused the following code on frame 50
-------
stop();
import mx.video.*;
my_FLVPlybk.contentPath = "myVideo.flv";
//
var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void
{
      movieComplete();
};
my_FLVPlybk.addEventListener("complete", listenerObject);
movieComplete = function ()
{
      gotoAndPlay(1);
};
----------

Rgds
Aneesh
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Fern2Author Commented:
thx again you are a true wizard of flash.

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

no.. not me.. :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.