Symbol 2 MovieClip Frame 1
#initclip 1
_global.ExternalFLV = function () {
};
//ExternalFLV extends MovieClip
ExternalFLV.prototype.seekToPrevOffset = 0.25;
ExternalFLV.prototype._volume = 100;
ExternalFLV.prototype._muted = false;
ExternalFLV.prototype.__set__volume = function (volume) {
this._volume = volume;
if (!this.muted) {
this._sound.setVolume(volume);
} else {
this._sound.setVolume(0);
}
};
ExternalFLV.prototype.__get__volume = function () {
return(this._volume);
};
ExternalFLV.prototype.addProperty("volume", ExternalFLV.prototype.__get__volume, ExternalFLV.prototype.__set__volume);
ExternalFLV.prototype.__set__muted = function (muted) {
this._muted = muted;
this.volume = this.volume;
};
ExternalFLV.prototype.__get__muted = function () {
return(this._muted);
};
ExternalFLV.prototype.addProperty("muted", ExternalFLV.prototype.__get__muted, ExternalFLV.prototype.__set__muted);
ExternalFLV.prototype.__set__playheadTime = function (time) {
this.seek(time);
};
ExternalFLV.prototype.__get__playheadTime = function () {
return(this._ns.time);
};
ExternalFLV.prototype.addProperty("playheadTime", ExternalFLV.prototype.__get__playheadTime, ExternalFLV.prototype.__set__playheadTime);
ExternalFLV.prototype.__set__playheadPercentage = function (pct) {
this.seekPercentage(pct);
};
ExternalFLV.prototype.__get__playheadPercentage = function () {
return((this._ns.time / this.totalTime) * 100);
};
ExternalFLV.prototype.addProperty("playheadPercentage", ExternalFLV.prototype.__get__playheadPercentage, ExternalFLV.prototype.__set__playheadPercentage);
ExternalFLV.prototype.__set__bufferTime = function (time) {
this._ns.setBufferTime(time);
};
ExternalFLV.prototype.__get__bufferTime = function () {
return(this._ns.bufferTime);
};
ExternalFLV.prototype.addProperty("bufferTime", ExternalFLV.prototype.__get__bufferTime, ExternalFLV.prototype.__set__bufferTime);
ExternalFLV.prototype.__get__bufferLength = function () {
return(this._ns.bufferLength);
};
ExternalFLV.prototype.addProperty("bufferLength", ExternalFLV.prototype.__get__bufferLength, null);
ExternalFLV.prototype.__get__bytesLoaded = function () {
return(this._ns.bytesLoaded);
};
ExternalFLV.prototype.addProperty("bytesLoaded", ExternalFLV.prototype.__get__bytesLoaded, null);
ExternalFLV.prototype.__get__bytesTotal = function () {
return(this._ns.bytesTotal);
};
ExternalFLV.prototype.addProperty("bytesTotal", ExternalFLV.prototype.__get__bytesTotal, null);
ExternalFLV.prototype.__get__currentFps = function () {
return(this._ns.currentFps);
};
ExternalFLV.prototype.addProperty("currentFps", ExternalFLV.prototype.__get__currentFps, null);
ExternalFLV.prototype.__get__loadedPercentage = function () {
if (this._ns.bytesLoaded <> 0) {
return((this._ns.bytesLoaded / this._ns.bytesTotal) * 100);
}
return(0);
};
ExternalFLV.prototype.addProperty("loadedPercentage", ExternalFLV.prototype.__get__loadedPercentage, null);
ExternalFLV.prototype._load = function (url) {
this.url = url;
this._nc = new NetConnection();
this._nc.connect(null);
this._ns = new NetStream(this._nc);
this._ns.setBufferTime(1);
this._ns.mc = this;
this._ns.onMetaData = function (infoObject) {
this.mc.metadata = infoObject;
this.mc.cuePoints = infoObject.cuePoints;
for (var i in this.mc.cuePoints) {
var cp = this.cuePoints[i];
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (!((cp.name == "") or (cp.name == undefined))) {
var cparray = (cp.type add "Points");
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (this.mc[cparray] == undefined) {
this.mc[cparray] = new Array();
}
this.mc[cparray].push(cp);
}
}
this.mc.videoHeight = infoObject.height;
this.mc.videoWidth = infoObject.width;
this.mc.totalTime = infoObject.duration;
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (infoObject.lasttimestamp != undefined) {
(infoObject.lasttimestamp);// not popped
} else {
"onMetaData"[this.mc] = "lastFrameTime";
}
"onMetaData"[this.mc] = "lastFrameTime";
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (infoObject.lastkeyframetimestamp != undefined) {
(infoObject.lastkeyframetimestamp);// not popped
} else {
this._ns[this.mc] = "lastKeyFrameTime";
}
this._ns[this.mc] = "lastKeyFrameTime";
this.mc.onMetadata(infoObject);
};
this._ns.onCuePoint = function (infoObject) {
this.mc.onCuePoint(infoObject);
};
this._ns.onStatus = function (infoObject) {
if (infoObject.code == "NetStream.Play.StreamNotFound") {
this.mc.onNotFound();
}
if (infoObject.code == "NetStream.Play.Start") {
this.mc.onPlayStart();
}
if (infoObject.code == "NetStream.Play.Stop") {
this.mc.onPlayStop();
}
if (infoObject.code == "NetStream.Seek.Notify") {
this.mc.onSeekDone();
}
this.mc.onStatus(infoObject);
};
this._video.attachVideo(this._ns);
this.attachAudio(this._ns);
this._sound = new Sound(this);
this._ns.play(url);
this.playing = true;
};
ExternalFLV.prototype.load = function (url) {
(this);// not popped
this._load(url);
this._ns.pause(true);
this.playing = false;
};
ExternalFLV.prototype.play = function (url) {
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (url != undefined) {
(this);// not popped
this._load(url);
}
this._ns.pause(false);
this.playing = true;
};
ExternalFLV.prototype.stop = function () {
this._ns.pause(true);
this.playing = false;
this._ns.seek(0);
};
ExternalFLV.prototype.pause = function () {
this._ns.pause(true);
this.playing = false;
};
ExternalFLV.prototype.seek = function (time) {
this._ns.seek(((time < this.lastFrameTime) ? (((time < 0) ? 0 : (time))) : (this.lastFrameTime)));
};
ExternalFLV.prototype.seekSeconds = ExternalFLV.prototype.seek;
ExternalFLV.prototype.seekPercentage = function (pct) {
this.seek((pct * this.totalTime) / 100);
};
ExternalFLV.prototype.seekToNextNavCuePoint = function (time) {
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (time == undefined) {
var time = this._ns.time;
}
var best = this.lastKeyFrameTime;
for (var i in this.cuePoints) {
var cp = this.cuePoints[i];
if (cp.type == "navigation") {
if (time < cp.time) {
if (cp.time < best) {
best = cp.time;
}
}
}
}
this.seek(best);
};
ExternalFLV.prototype.seekToPrevNavCuePoint = function (time) {
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (time == undefined) {
var time = this._ns.time;
}
var first = true;
while (var best = 0 , for (var i in this.cuePoints) {
var cp = this.cuePoints[i]if (cp.type == "navigation") {
if (cp.time < time) {
if (best < cp.time) {
best = cp.time}
}
}
}
, first) {
var first = false;
if (best < (time - this.seekToPrevOffset)) {
break;
}
time = best;
}
this.seek(best);
};
ExternalFLV.prototype.close = function () {
this._ns.close();
};
#endinitclip
Symbol 3 MovieClip [_3] Frame 1
#initclip 2
Object.registerClass("_3", ExternalFLV);
#endinitclip
this.play("Fireplace.flv");