Frame 1
nc = new NetConnection();
nc.onStatus = function (info) {
trace((("Level: " + info.level) + " Code: ") + info.code);
if (info.code == "NetConnection.Connect.Success") {
trace("--- connected to: " + this.uri);
}
};
NetConnection.prototype.onBWDone = function (p_bw) {
trace("onBWDone: " + p_bw);
detected_bw = p_bw;
this.close();
gotoAndStop (2);
};
NetConnection.prototype.onBWCheck = function () {
return(++counter);
};
nc.connect("rtmp://media.permint.com/bwcheck", true);
stop();
Frame 2
nc = new NetConnection();
nc.onStatus = function (info) {
trace((("Level: " + info.level) + " Code: ") + info.code);
if (info.code == "NetConnection.Connect.Success") {
trace("--- connected to: " + this.uri);
initStream();
}
};
nc.connect("rtmp://media.permint.com/engraveit");
initStream = function () {
var _local2 = substring(this._url, 0, this._url.lastIndexOf("/"));
trace(_local2);
if (_local2 != "https://video.permint.com/swf") {
useVideo = "FRAUD";
bufferlength = 8;
} else if (detected_bw > 300) {
useVideo = "engraveit_FLV_300k_Stream_2";
bufferlength = 5;
} else if ((detected_bw <= 300) && (detected_bw >= 150)) {
useVideo = "engraveit_FLV_150k_Stream_2";
bufferlength = 5;
} else if ((detected_bw < 150) && (detected_bw >= 112)) {
useVideo = "engraveit_FLV_112k_Stream_2";
bufferlength = 8;
} else if ((detected_bw < 112) && (detected_bw >= 90)) {
useVideo = "engraveit_FLV_090k_Stream_2";
bufferlength = 15;
} else if ((detected_bw < 90) && (detected_bw >= 64)) {
useVideo = "engraveit_FLV_064k_Stream_2";
bufferlength = 15;
} else if ((detected_bw < 64) && (detected_bw >= 40)) {
useVideo = "engraveit_FLV_039k_Stream_2";
bufferlength = 15;
} else if ((detected_bw < 40) && (detected_bw >= 20)) {
useVideo = "engraveit_FLV_020k_Stream_2";
bufferlength = 15;
} else {
trace("bandwidth too low");
}
video_ns = new NetStream(nc);
video_ns.onStatus = function (info) {
trace((("Level: " + info.level) + " Code: ") + info.code);
};
video_ns.setBufferTime(bufferlength);
videoObj.attachVideo(video_ns);
video_ns.play(useVideo, 0);
playButton.onRelease = function () {
video_ns.pause(useVideo, 0);
};
stopButton.onRelease = function () {
video_ns.pause(useVideo, 0);
};
stepBack.onRelease = function () {
video_ns.seek(video_ns.time - 15);
};
stepForward.onRelease = function () {
video_ns.seek(video_ns.time + 15);
};
};
stop();
Symbol 12 Button
on (release) {
globalsound = new Sound();
globalsound.setVolume(0);
gotoAndStop (2);
}
Symbol 13 Button
on (release) {
globalsound = new Sound();
globalsound.setVolume(100);
gotoAndStop (1);
}
Symbol 15 MovieClip Frame 1
stop();
Symbol 15 MovieClip Frame 2
stop();