dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: NetStream help

  1. #1
    Member
    Join Date
    May 2004
    Posts
    60

    NetStream help

    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)

    Code:
    //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)

    Code:
    //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

  2. #2
    Junior Member
    Join Date
    Dec 2005
    Posts
    3
    I can't remember exactly how it went, but I had a similar issue and really it came down to declaring vs not declaring. for example, it had to do with strongly declaring the NetStream object or something dumb like that.

    I'm messing around with it myself, if I have something come up I'll get back to you.

  3. #3
    Member
    Join Date
    May 2004
    Posts
    60
    Thanks for taking a look. This one really has me stumped

    greg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center