FORUMS: list search recent posts

FLVs and netStream

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jeff Penano
FLVs and netStream
on Jun 13, 2007 at 4:19:19 pm

I seem to be having trouble creating a dynamic video page layout with Flash 8 (publishing to 7). On a particular page I'm loading in an external .swf that has a video object in it. That way I can add and remove it easily with the MovieClipLoader class and removeMovieClip(). Everything seems to be working fine except for the part of actually attaching the video object to the netStream. Anyone have any ideas? Code is as follows:

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Load FLV Video Layout ____________________________________________________
function loadFLV(theFLV:String, theAutoStart:Boolean) {
_root.createEmptyMovieClip("pic_mc", depth+=10);


var my_nc:NetConnection = new NetConnection();
// Create a local streaming connection
my_nc.connect(null);
// Create a NetStream object and define an onStatus() function
var my_ns:NetStream = new NetStream(my_nc);
my_ns.onStatus = function(infoObject:Object):Void {
status_txt.text += "status (" + this.time + " seconds)n";
status_txt.text += "t Level: " + infoObject.level + "n";
status_txt.text += "t Code: " + infoObject.code + "nn";
};

this.createTextField("status_txt", depth+=10, 0, 0, 100, 100);
status_txt.autoSize = "left";
status_txt.multiline = true;
//
var vidListener:Object = new Object();
vidListener.onLoadInit = function(target_mc:MovieClip) {
pic_mc._x = 350;
pic_mc._y = 200;
//pic_mc.attachMovie("videoObject","videoHolder_mc",depth+=10);
this.createTextField("status_txt", this.getNextHighestDepth(), 10, 30, 300, 100);
status_txt.multiline = true;
status_txt.html = true;
// Attach the NetStream video feed to the Video object
_root.pic_mc.vid.attachVideo(my_ns);
// Set the buffer time
my_ns.setBufferTime(5);
// Begin playing the FLV file
playThis = "test1.flv";
my_ns.play(playThis);
}
//
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(vidListener);
mcLoader.loadClip("video/vidSWF.swf",pic_mc);
}
// Load FLV Video Layout ____________________________________________________
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


Return to posts index

Jeff Penano
Re: FLVs and netStream
on Jun 13, 2007 at 5:16:02 pm

I seem to have figured it out. It was merely a pathing issue when targeting which flv to play with the ns.play() function. I was targeting the flv relative to the html page that was loading in the main interface .swf when I need to define the path relative to the .swf itself. Must be something in the way that netConnection works since I path out to all other media relative to the html.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]