# eventListener on a flv not workin'

**URL:** <https://forum.kirupa.com/t/eventlistener-on-a-flv-not-workin/265062>\
**Category:** flash\
**Created:** [July 3, 2008, 2:43pm UTC](https://forum.kirupa.com/t/eventlistener-on-a-flv-not-workin/265062 "2008-07-03T14:43:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccbayer](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@ccbayer](https://forum.kirupa.com/u/ccbayer)\
**Post date:** [July 3, 2008, 2:43pm UTC](https://forum.kirupa.com/t/eventlistener-on-a-flv-not-workin/265062/1 "2008-07-03T14:43:25Z")

</div>

Hey guys,  
I want to add a simple “play again” button when my FLV stops playing. Pretty simple, right? For whatever reason I can’t add an eventListener when my video stops though. I can’t even trace anything. the video loads i can dynamically change the volume so it’s not like i’m referencing it wrong or something like that. Any ideas?

```auto
//stop swf playback
stop();
import mx.video.*;
//load .flv
_root.myFlv.contentPath = "../iron.flv";

//new listener to show "play again" btn
var listenerObject:Object = new Object();
_root.myFlv.addEventListener("complete", listenerObject);
listenerObject.complete = function(eventObject:Object):Void {
replayBtn._alpha = 100;
};

```

---

<div class="post-metadata">

**Author:** ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)\
**Post date:** [July 3, 2008, 3:14pm UTC](https://forum.kirupa.com/t/eventlistener-on-a-flv-not-workin/265062/2 "2008-07-03T15:14:00Z")

</div>

first guess is that you need to define the ‘complete’ function before assiging the eventListener to the flv object. like this:

```auto
//stop swf playback
stop();
import mx.video.*;
//load .flv
_root.myFlv.contentPath = "../iron.flv";

//new listener to show "play again" btn
var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
replayBtn._alpha = 100;
};
_root.myFlv.addEventListener("complete", listenerObject);

```

---

<div class="post-metadata">

**Author:** ![ccbayer](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@ccbayer](https://forum.kirupa.com/u/ccbayer)\
**Post date:** [July 3, 2008, 3:20pm UTC](https://forum.kirupa.com/t/eventlistener-on-a-flv-not-workin/265062/3 "2008-07-03T15:20:39Z")

</div>

i initially tried that…didn’t make a difference, unfortunately. could the FLV be rewinding prior to “completing”??

---

<div class="post-metadata">

**Author:** ![btibia](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/btibia/32/1625_2.png) [@btibia](https://forum.kirupa.com/u/btibia)\
**Post date:** [July 4, 2008, 10:27am UTC](https://forum.kirupa.com/t/eventlistener-on-a-flv-not-workin/265062/4 "2008-07-04T10:27:38Z")

</div>

Check the NetStatus class in the help panel and you’ll find your solution very fast. When a video have finish playing it “throws” a string 🙂 You capture that and change the \_alpha to 100 to your replay button

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [July 4, 2008, 11:40am UTC](https://forum.kirupa.com/t/eventlistener-on-a-flv-not-workin/265062/5 "2008-07-04T11:40:49Z")

</div>

isn’t it netStream? for googley reference
