FORUMS: list search recent posts

netStream object help

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
gregSinibaldi
netStream object help
on Nov 30, 2005 at 9:42:57 pm

Hello,

I've gone through Lee Brimlows Video Basics tutorial and am in corporating some of whwat I learned with the MM tutorial creating an XML dynamic playlist. I've got most of it working but I'm having trouble with the video player controls.

For some reason I'm not able to "get" my NetStream object for things like the scubb bar and volume button. I'm using an #include file for the netconnection and stream. Its also connecting to a Flash COmm Server.

Heres my code for the connection (located in the #include file)

//Set up the list box, call function VideoThumb to create the actual thumbnails

list.rowHeight = 70;
list.cellRenderer = "VideoThumb";
list.selectable = true;

//create new empty listener object
listListener = {};

//Function to handle what happens when an item in the list is selected
listListener.change = function( evtobj ) {
var nav = list.dataProvider[list.selectedIndex];
nc = new NetConnection(); //create a connection
nc.connect( nav.attributes.url ); //connect to FCS
ns = new NetStream(nc); //create a stream
video.attachVideo(ns); //pipe stream to this video object
ns.connect(); //connect the stream
// walk through the chosen item, build and play it
var reset = true;
for ( var i = 0; i < nav.childNodes.length; i++ ) {
var stream = nav.childNodes[i];
if ( stream.nodeName == "stream" ) {
ns.play( stream.attributes.name, stream.attributes.start, stream.attributes.len, reset );
reset = false;
}
}
}

//Add an event listener on the list, when it triggers, run the listListener function to repopulate the list
list.addEventListener("change", listListener);

And my code for the mute button (from Lee's basic video tutorial #8)

//mute button
_root.createEmptyMovieClip("vSound",_root.getNextHighestDepth());
vSound.attachAudio(ns);

var so:Sound = new Sound(vSound);

so.setVolume(100);

mute_mc.onRollOver = function() {
if(so.getVolume()== 100) {
this.gotoAndStop("onOver");
}
else {
this.gotoAndStop("muteOver");
}
}

mute_mc.onRollOut = function() {
if(so.getVolume()== 100) {
this.gotoAndStop("on");
}
else {
this.gotoAndStop("mute");
}
}

mute_mc.onRelease = function() {
if(so.getVolume()== 100) {
so.setVolume(0);
this.gotoAndStop("muteOver");
}
else {
so.setVolume(100);
this.gotoAndStop("onOver");
}
}

I've tried tracing my netStream object but nothing comes in, even though the video plays. My roll over states work for the mute button too but the volume doesnt change

Any idea on what I'm missing?

Thanks

Greg



Return to posts index

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