开发者

ActionScript 2.0 listener's onComplete fires immediately

开发者 https://www.devze.com 2023-01-14 03:16 出处:网络
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.

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开发者_如何学Go?) 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消