A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: srcStream.publish(my_variable, "live")???

  1. #1
    Member
    Join Date
    Aug 2001
    Posts
    76
    I am trying to publish and recieve video streams using a variable.

    The following code uses "Bobby" instead of a variable and works great...

    **********************
    nc = new NetConnection();
    nc.connect("rtmp:/my_app/room_01");
    usrStream = new NetStream(nc);
    usrStream.publish("Bobby", "live");
    usrStream.attachVideo(Camera.get());
    lsrStream = new NetStream(nc);
    User_video.attachVideo(lsrStream);
    lsrStream.play("Bobby");
    **********************

    This code replaces Bobby with the variable _root.user and doesn't work...

    **********************
    nc = new NetConnection();
    nc.connect("rtmp:/my_app/room_01");
    usrStream = new NetStream(nc);
    usrStream.publish(_root.user, "live");
    usrStream.attachVideo(Camera.get());
    lsrStream = new NetStream(nc);
    User_video.attachVideo(lsrStream);
    lsrStream.play(_root.user);
    **********************

    I set the variable _root.user before I execute the above script, and I display the variable in a dynamic text box (just for testing) and it displays the correct data... "Bobby"

    My assumption is that I am not calling the variable correctly, maybe a + is missing or something.

    Any insight would be greatly appreciated.
    Thanks

  2. #2
    Danny Gomez Creations ® cosmiceye's Avatar
    Join Date
    Mar 2002
    Location
    under a palmtree in Jamaica waiting for psytopia 2005 to begin
    Posts
    982
    !!!...I dont know if u will cry or laugh at the only thing u need to change:
    Code:
    _root.user
    //should be
    _root.user.text
    the trace showed you the name becouse it showed the value of _root.user .But the ns needs the string data from the boxes and to pull that out u just use:
    Code:
     myDynamicTextBox.text

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