views:

30

answers:

1

Please forgive any short-comings in this question; flash is not my area of expertise, but I've inherited a task that deals with AS2 that I need some help with.

Basically, I have a flash document (a loader?) with the following AS 2.0 code:

stop();

import mx.video.*;
var listenerObject:Object = new Object();

listenerObject.complete = function(eventObject:Object):Void {
       getUrl("/page.aspx");
};

my_FLVPlybk.addEventListener("complete", listenerObject);
my_FLVPlybk.contentPath = "http://cache.url.com/path/movie.flv";

Basically, the idea is after the movie finishes playing, you should get redirected to a new page.

The problem is that sometimes the page redirects immediately (before the movie is played). The movies are being served up from a media server and this seems to happen more consistently with newly uploaded movies. Sometimes it takes several attempts to actually play the movie all the way through, but over time, the movies generally start to play problem-free.

Any idea why the 'complete' event fires so early with new movies and how to fix it?

A: 

If you're using progressive download, the duration of the video may not be entirely accurate. You could try to monitor the progress event and check if your video is still downloading in which case you don't want to listen/react to the complete event.

PatrickS