Combined Code
frame 1 {
function toggleVideo(which) {
switch (which) {
case 0:
v.clear();
snd.stop();
break;
case 1:
v.attachVideo(ns);
snd = new Sound();
snd.attachAudio(ns);
snd.setVolume(100);
snd.start();
}
}
Stage.align = '';
Stage.scaleMode = 'noScale';
var nc = new NetConnection();
var nsnc = new NetConnection();
var initd = 0;
nc.onStatus = function (info) {
trace(info.code);
if (info.code == 'NetConnection.Connect.Success') {
trace('derp');
}
};
nc.init = function () {
so = SharedObject.getRemote('ucSO', nc.uri, false);
so.onSync = function (info) {
txt.text = so.data.count;
};
so.connect(nc);
ns = new NetStream(nsnc);
ns.setBufferTime(3);
ns.play('livestream');
ns.onStatus = function (info) {
trace(info.code);
switch (info.code) {
case 'NetStream.Play.UnpublishNotify':
toggleVideo(0);
break;
case 'NetStream.Buffer.Full':
toggleVideo(1);
}
};
};
nc.connect('rtmp://lolomgwhatrudoin.mooo.com/myApp/inst1');
nsnc.connect('rtmp://lolomgwhatrudoin.mooo.com/live');
}