enventListener not trigged?

  • rotsee
  • Born
  • Born
  • rotsee
  • Posts: 1

Post 3+ Months Ago


I'm playing a FLV-file in my flash-movie, using FLVPlayback (compiled clip). Now I need to execute some code when the movie stops och when the user navigates to another frame using any of a number of buttons. I googled and found a lot of instructions that all looked something like this (my code now):

Code: [ Select ]
var enventListener:Object = new Object();
enventListener.completed = function(eventObject:Object):Void{
_root.Kapitel1_film.addEventListener("completed",e ventListener);
  1. var enventListener:Object = new Object();
  2. enventListener.completed = function(eventObject:Object):Void{
  3. trace("THIS NEVER HAPPENS!");
  4. }
  5. _root.Kapitel1_film.addEventListener("completed",e ventListener);

where Kapitel1_film is my flv-clip. I tried all different events I could come up with (stopped, statusChange, etc), but nothing ever happens.
I can access the clip, though. E.g. _root.Kapitel1_film.height will give a correct value.
Trace(_root.Kapitel1_film.state) used in the same frame gives 'disconnected', otherwise 'undefined'. All code is in the same frame and same scene as the embedded flv. I'm a newbie here, so I'm probably missing something obvious.
  • zhaojany
  • Student
  • Student
  • User avatar
  • Posts: 79

Post 3+ Months Ago

Code: [ Select ]
import mx.video.*;
var Kapitel1_film:FLVPlayback;
var eventListener:Object = new Object();
eventListener.complete = function(eventObject:Object):Void
    trace("THIS NEVER HAPPENS!");
  1. import mx.video.*;
  2. var Kapitel1_film:FLVPlayback;
  3. var eventListener:Object = new Object();
  4. eventListener.complete = function(eventObject:Object):Void
  5. {
  6.     trace("THIS NEVER HAPPENS!");
  7. };
  8. Kapitel1_film.addEventListener("complete",eventListener);
  9. Kapitel1_film.load("test.flv");
  10. Kapitel1_film.play();

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 3 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

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.