?
Solved

When video/flv ends do gotoAndPlay(xxx)

Posted on 2006-03-29
5
Medium Priority
?
447 Views
Last Modified: 2008-02-26
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?
0
Comment
Question by:Fern2
  • 2
  • 2
5 Comments
 
LVL 1

Author Comment

by:Fern2
ID: 16322482
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
 
LVL 34

Accepted Solution

by:
Aneesh Chopra earned 2000 total points
ID: 16323849
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
 
LVL 1

Author Comment

by:Fern2
ID: 16323960
thx again you are a true wizard of flash.

bytheway...is that you in the video :)
0
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 16324223
thanx for the appreciation

no.. not me.. :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question