# AS3 help with stopping Vimeo Video - help please!

**URL:** <https://forum.kirupa.com/t/as3-help-with-stopping-vimeo-video-help-please/305257>\
**Category:** flash\
**Created:** [February 22, 2010, 1:54pm UTC](https://forum.kirupa.com/t/as3-help-with-stopping-vimeo-video-help-please/305257 "2010-02-22T13:54:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![magicRoyal](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@magicRoyal](https://forum.kirupa.com/u/magicRoyal)\
**Post date:** [February 22, 2010, 1:54pm UTC](https://forum.kirupa.com/t/as3-help-with-stopping-vimeo-video-help-please/305257/1 "2010-02-22T13:54:01Z")

</div>

I am quite new to AS3, and I am finding a few things tricky.

I have imported a link to a Vimeo Video in Flash CS4 using AS3, with the following code:

stop();

btnNextProject.addEventListener(MouseEvent.CLICK, advance);  
function advance(event:MouseEvent) {  
gotoAndStop(“Video2”);  
}

import flash.system.Security;  
import flash.net.URLRequest;  
import flash.display.Loader;  
import flash.events.Event;  
import flash.events.ProgressEvent;

var moogaloop:Sprite = new Sprite(); // the video player  
var player\_width:int=364;  
var player\_height:int=272;  
var clip\_id:int = 9383301;

function startLoad():void  
{  
Security.allowDomain(“[bitcast.vimeo.com](http://bitcast.vimeo.com)”);  
var v\_loader:Loader = new Loader();  
var v\_request = new URLRequest(“[http://bitcast.vimeo.com/vimeo/swf/moogaloop.swf?clip\_id=](http://bitcast.vimeo.com/vimeo/swf/moogaloop.swf?clip_id=)” + clip\_id + “&[server=vimeo.com](http://server=vimeo.com)” + “&width=” + player\_width + “&height=” + player\_height + “&show\_title=0&show\_byline=0&show\_portrait=0&color=ffffff&fullscreen=1”);  
v\_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);  
v\_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);  
v\_loader.load(v\_request);  
}

function onCompleteHandler(e:Event):void  
{  
// Position the player where you want it  
moogaloop.x = 42;  
moogaloop.y = 101;  
moogaloop.addChild(e.currentTarget.content);

```
// Create the mask for moogaloop
var v_mask:Sprite = new Sprite();
with( v_mask.graphics ) {
    beginFill(0x000000, 1);
    drawRect(moogaloop.x, moogaloop.y, player_width, player_height);
    endFill();
}

addChild(v_mask);
moogaloop.mask = v_mask;

addChild(moogaloop);

```

}

function onProgressHandler(e:ProgressEvent):void  
{  
var percent:Number = e.bytesLoaded / e.bytesTotal;  
trace(percent);  
}

startLoad();

The code is on a frame half way into the movie, and also has a button to advance to another frame.

Right the problem is, when clicking onto the next frame, the flippin video stills keeps playing over the top of all the other content. Help, please this is driving me up the wall, any help would be great - many thanks 🙂
