# ActionScript 2.0 video problem

**URL:** <https://forum.kirupa.com/t/actionscript-2-0-video-problem/226146>\
**Category:** flash\
**Created:** [May 18, 2007, 1:22pm UTC](https://forum.kirupa.com/t/actionscript-2-0-video-problem/226146 "2007-05-18T13:22:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigxb](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@craigxb](https://forum.kirupa.com/u/craigxb)\
**Post date:** [May 18, 2007, 1:22pm UTC](https://forum.kirupa.com/t/actionscript-2-0-video-problem/226146/1 "2007-05-18T13:22:01Z")

</div>

I’ve set up a NetStream object that I’m loading a video into, and the video starts playing when I roll over a button. When I roll away from the button, the video stops playing.

For the most part, this works, but if I quickly hover over the button and then rollOut immediately, the video keeps playing. It only works properly if I hover over the button, wait for the video to start playing and THEN roll away from it.

How do I fix this??? Here’s my ActionScript:

import mx.transitions.Tween;  
import mx.transitions.easing.\*;

var nc:NetConnection = new NetConnection();  
nc.connect(null);  
var ns:NetStream = new NetStream(nc);  
myVideo.attachVideo(ns);

var startWidth:Number = mask\_mc.\_width;  
var maxWidth:Number = Stage.width;  
var tweenOver:Tween;  
var tweenOut:Tween;

inv\_btn.onRollOver = function() {  
tweenOver = new Tween(mask\_mc,"\_width",Regular.easeOut,startWidth,maxWidth,1,true);  
tweenOver.onMotionFinished = function() {  
ns.play(“bungee\_ball.flv”);  
}  
}

inv\_btn.onRollOut = function(){  
tweenOut = new Tween(mask\_mc,"\_width",Regular.easeOut,mask\_mc.\_width,startWidth,1,true);  
ns.pause(true);  
}
