Listeners not working. {update}

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post January 13th, 2006, 7:51 pm

graphixboy wrote:
So i've been playing with the FLVPlayback for the last week as well and I just had an interesting thought. Did you try the file off your local hard drive? and if so does it still lag at the end?

Here's my thought.

There's an option for buffer time and I'm wondering if the video caches in your browser might you be able to set the buffer to 0 or 0.01 seconds the second time you play the loop and therefore eliminate the pause that would be needed to cache the video?

I just ran into something similar off a cdrom drive and dumping the buffer seemed to help.


buffertime by default was set to 0.10 and I've tried longer buffer times too. I also tried 0.00 and no difference. For most tests I just use flash itself to test it and the file currently is on the local machine, however it doesn't make any difference if it's on my local machine or on the server and I try browser access. ( i always clear cache, close browser and reopen before I replay it just to be safe).

//edit -- by using the trace options I mentioned earlier I know exactly when and where the "glitch" occurs and why. It occurs at the end of the file when the file stops and flash "rewinds" an "buffers" and starts "play" again. That's why I'm interested in figuring out how to use these cue points. The cuepoint itself is not going to stop the movie. It's going to be an indicator that I can set an action to. I'm thinking if I set the cuepoint at about a second before the movie ends to go back to "beginLoop" cue point, I can compensate for the delay. At least that's my logic. I might be offbase, but I don't think so.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post January 13th, 2006, 7:51 pm

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post January 13th, 2006, 8:05 pm

My problem is basically here I think

Code: [ Select ]
listenerObject.cuePoint = function(eventObject:Object):Void {
  // Seek to Cue Name Behavior
  var myCue = eventObject.info.name;
  if (myCue == "endLoop") {
  var c = this.my_FLVPlybk.findCuePoint("beginLoop");
  this.my_FLVPlybk.seekSeconds(c.time);
  this.my_FLVPlybk.play("cuepointloop12.flv");
  }
  // End Seek to Cue Name Behavior
  1. listenerObject.cuePoint = function(eventObject:Object):Void {
  2.   // Seek to Cue Name Behavior
  3.   var myCue = eventObject.info.name;
  4.   if (myCue == "endLoop") {
  5.   var c = this.my_FLVPlybk.findCuePoint("beginLoop");
  6.   this.my_FLVPlybk.seekSeconds(c.time);
  7.   this.my_FLVPlybk.play("cuepointloop12.flv");
  8.   }
  9.   // End Seek to Cue Name Behavior


No matter how I try to write the statement, it basically ignores all my attempts.
I'm thinking what I need is:

if cuepoint.name = endLoop
then
go to cuepoint.name(beginLoop)
and play beginLoop

I'm quite certain that my problem is not understanding how to write that out in proper Action Script
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post February 1st, 2006, 1:52 pm

Just an update, I did finally after a lot of searching and reading, solved the cuePoint thing. This code finally worked just fine.



import mx.video.*;
var listenerObject1:Object = new Object();
listenerObject1.cuePoint = function(eventObject:Object):Void {
var cuePtName = eventObject.info.name;
if (cuePtName == "endLoop") {
my_FLVPlybk.seekToNavCuePoint(0.0);

//below just verifies cuePoints
trace("Elapsed time in seconds: " + my_FLVPlybk.playheadTime);
trace("Cue point name is: " + eventObject.info.name);
trace("Cue point type is: " + eventObject.info.type);
}
};
my_FLVPlybk.addEventListener("cuePoint", listenerObject1);

//added to trace state changes
var listenerObject2:Object = new Object();
listenerObject2.stateChange = function(eventObject:Object):Void {
trace(my_FLVPlybk.state);
};
my_FLVPlybk.addEventListener("stateChange", listenerObject2);


However, it didn't do what I was hoping, and that is elliminate the slight hesitation between the end of the playback and the restart to make a seamless loop. I figured by using the cuePoint listener I could tell the player exactly when the video is over and where it begins, but the playback seems insistant upon that little hesitation (even with the buffer set to zero). In fact it doesn't seem to matter what I set the buffer at. I'd almost assume this is just something about Flash that I'd have to live with, except I've seen seamless loops with FLVPlayback, but nobody really gives a good explanation of how to do it.

Here's an example of one that is seamless
http://theflashblog.com/?p=86

However, I'm discouraged by this quote in the replies:

Quote:
Administrator Says:

1. November 17th, 2005 at 1:20 pm If you want to get these video clips to loop seamlessly in Flash you need to embed them into your SWF. Keeping them as external FLV files will not allow them to loop correctly.

I have to leave mine external. It's almost 8MB and if I embed it, it makes the swf file huge and unmanageable for page loading. So am I stuck? Am I going to have to live with this "glitch" on all the animation loops I make, or is there a way around this?
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.

Post Information

  • Total Posts in this topic: 18 posts
  • Users browsing this forum: No registered users and 35 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.