# Desperate for help. Flash video

**URL:** <https://forum.kirupa.com/t/desperate-for-help-flash-video/52517>\
**Category:** Uncategorized\
**Created:** [May 24, 2004, 8:51pm UTC](https://forum.kirupa.com/t/desperate-for-help-flash-video/52517 "2004-05-24T20:51:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![said7](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@said7](https://forum.kirupa.com/u/said7)\
**Post date:** [May 24, 2004, 8:51pm UTC](https://forum.kirupa.com/t/desperate-for-help-flash-video/52517/1 "2004-05-24T20:51:35Z")

</div>

Hey,

Im building a page with flash video. Heres the code i got so far.

function loadvideo() {  
my\_nc = new NetConnection();  
my\_nc.connect(null);  
my\_ns = new NetStream(my\_nc);  
videoloader.my\_video.attachVideo(my\_ns);  
my\_ns.play(\_root.media\_path add \_root.ShowID add “/defaultvideo.flv”);  
}  
function stopvideo() {  
trace(“video stopped”);  
my\_ns.close();  
}  
function pausevideo() {  
trace(“video pause/play”);  
my\_ns.pause([pauseResume]);  
}

This code works fine for loading and pausing and stopping the video.  
What i need to do is trigger something to happen when the video is complete. I searched macromedias help and tried this…

my\_ns.onStatus.NetStream.Play.Stop = function() {  
this.videoloader.blackfade.play();  
};

But it didnt do anything. How can i run a function automatically when the video ends?

Please help me out 🙂 Ive been searching for days.
