# Please help, controlling an external flv (not component)

**URL:** https://forum.kirupa.com/t/please-help-controlling-an-external-flv-not-component/274732
**Category:** Uncategorized
**Created:** [November 3, 2008, 8:15pm UTC](https://forum.kirupa.com/t/please-help-controlling-an-external-flv-not-component/274732 "2008-11-03T20:15:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![wuzzi2ya](https://avatars.discourse-cdn.com/v4/letter/w/e79b87/32.png) [@wuzzi2ya](https://forum.kirupa.com/u/wuzzi2ya)
#### Post date: [November 3, 2008, 8:15pm UTC](https://forum.kirupa.com/t/please-help-controlling-an-external-flv-not-component/274732/1 "2008-11-03T20:15:26Z")

</div>

Below is the code for loading in my flv within its own swf (other). The swf is loaded from another swf (main) through a loader. What I need to do now is to stop, pause and or seek the flv inside (other), from the (main) swf. Or… I need to navigate back to the (main) swf from inside the (other) swf… I am goin crazy with this, and I hope it is a simple procedure, so please throw me a bone…

[COLOR=“Cyan”]//(other)loads the flv[/COLOR]  
var vid:Video;  
var nc:NetConnection;  
var ns:NetStream;  
var vidURL:String = “architechture.flv”;

nc = new NetConnection();  
nc.addEventListener(NetStatusEvent.NET\_STATUS, netStatusHandler);  
nc.addEventListener(SecurityErrorEvent.SECURITY\_ERROR, securityErrorHandler);  
nc.connect(null);

function netStatusHandler(event:NetStatusEvent):void {  
switch (event.info.code) {  
case “NetConnection.Connect.Success” :  
playVideo();  
break;  
case “NetStream.Play.StreamNotFound” :  
trace(“Unable to load video.”);  
break;  
}  
}

function playVideo():void {  
ns = new NetStream(nc);  
ns.addEventListener(NetStatusEvent.NET\_STATUS, netStatusHandler);  
ns.addEventListener(AsyncErrorEvent.ASYNC\_ERROR, asyncErrorHandler);  
vid = new Video(480, 360);  
vid.x = 348;  
vid.y = 119;  
vid.attachNetStream(ns);  
ns.play(vidURL);  
addChild(vid);  
}

function securityErrorHandler(event:SecurityErrorEvent):void {  
trace("securityErrorHandler: " + event);  
}

function asyncErrorHandler(event:AsyncErrorEvent):void {  
// ignore AsyncErrorEvent events.  
}

btnBack.addEventListener(MouseEvent.CLICK, skipp);  
function skipp(event:MouseEvent):void {  
removeChild(vid);  
ns.pause();  
ns.seek(0);  
if (this.parent != null) {  
this.parent.removeChild(this);  
gotoAndPlay(“skip”);  
}  
}

[COLOR=“Cyan”]//(main)loads in the swf containing the flv[/COLOR]  
var ArchLoader:Loader = new Loader();  
ArchLoader.load(new URLRequest(“arch\_const.swf”));  
addChild(ArchLoader);

[COLOR=“Cyan”]//(other) removes the sound and flv [/COLOR]  
btnBack.addEventListener(MouseEvent.CLICK, skipp);  
function skipp(event:MouseEvent):void {  
removeChild(vid);  
ns.pause();  
ns.seek(0);  
if (this.parent != null) {  
this.parent.removeChild(this);  
this.parent.parent.parent.gotoAndPlay(“skip”);  
}  
}

I have tried localConnection (never used it) as well, but maybe my syntax is incorrect…  
Any help is greatly appreciated…

Thanks
