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