Symbol 7 MovieClip Frame 1
stop();
Symbol 7 MovieClip Frame 2
stop();
Symbol 19 MovieClip Frame 1
stop();
Symbol 19 MovieClip Frame 2
stop();
Symbol 19 MovieClip Frame 3
stop();
Symbol 19 MovieClip Frame 4
stop();
Symbol 42 MovieClip [FVidControl] Frame 1
#initclip 1
function FVideoControlClass() {
this._xscale = (this._yscale = 100);
this.background_mc._xscale = (this.outline_mc._xscale = 100);
this.background_mc._x = (this.outline_mc._x = 0);
this.background_mc._y = (this.outline_mc._y = 0);
with (this.sliderBar_mc) {
_xscale = (_yscale = 100);
_y = _parent._height / 2;
sliderBarR._xscale = (sliderBarR._yscale = 100);
sliderBarM._xscale = (sliderBarR._yscale = 100);
sliderBarL._xscale = (sliderBarR._yscale = 100);
}
this.indicatorKnob_mc._x = this.sliderBar_mc._x;
this.indicatorKnob_mc._y = (this.sliderMask_mc._y = this._height / 2);
this.sliderMask_mc._visible = false;
if (this._targetInstanceName.length > 0) {
this.init();
this.setPosition(this._parent[this._targetInstanceName]);
}
this.tabEnabled = false;
this.tabChildren = false;
}
FVideoControlClass.prototype = new MovieClip();
FVideoControlClass.prototype.init = function () {
if (this.vcPlay) {
this.playVideo();
} else {
this.stopVideo();
}
this.keyListener = new Object();
this.keyListener.controller = this;
this.keyListener.onKeyDown = function () {
if (Key.isDown(32)) {
if (this.controller.isPlaying) {
this.controller.stopVideo();
} else {
this.controller.playVideo();
}
}
};
Key.addListener(this.keyListener);
this.play_btn.useHandCursor = false;
this.play_btn.onPress = function () {
if (this._currentframe == 1) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(4);
}
};
this.volume_btn.useHandCursor = false;
this.volume_btn.onPress = this.showVolume;
this.volume_btn.onRelease = (this.volume_btn.onReleaseOutside = this.hideVolume);
this.volume_btn.controller = this;
this.buttonsRight_mc.forward_btn.useHandCursor = false;
this.buttonsRight_mc.forward_btn.onPress = this.startFFW;
this.buttonsRight_mc.forward_btn.onRelease = (this.buttonsRight_mc.forward_btn.onReleaseOutside = this.removeFFWREW);
this.buttonsRight_mc.forward_btn.controller = this;
this.buttonsRight_mc.rewind_btn.useHandCursor = false;
this.buttonsRight_mc.rewind_btn.onPress = this.startREW;
this.buttonsRight_mc.rewind_btn.onRelease = (this.buttonsRight_mc.rewind_btn.onReleaseOutside = this.removeFFWREW);
this.buttonsRight_mc.rewind_btn.controller = this;
this.sliderBar_mc.useHandCursor = false;
this.sliderBar_mc.onPress = this.startSliderBar;
this.sliderBar_mc.onRelease = (this.sliderBar_mc.onReleaseOutside = this.stopSliderBar);
this.sliderBar_mc.controller = this;
this.indicatorKnob_mc.useHandCursor = false;
this.indicatorKnob_mc.onPress = this.startDragKnob;
this.indicatorKnob_mc.onRelease = (this.indicatorKnob_mc.onReleaseOutside = this.stopDragKnob);
this.indicatorKnob_mc.controller = this;
};
FVideoControlClass.prototype.setPosition = function (vidTarget) {
this._x = vidTarget._x;
this._y = vidTarget._height + vidTarget._y;
var sliderDiff = (this._width - this.sliderBar_mc.sliderBarM_mc._width);
this.background_mc._xscale = (this.outline_mc._xscale = (vidTarget._width / this.outline_mc._width) * 100);
this.background_mc._width = (this.outline_mc._width = this.outline_mc._width - 0.1);
this.buttonsRight_mc._y = 0;
this.buttonsRight_mc._x = this.background_mc._width - this.buttonsRight_mc._width;
this.sliderBar_mc.sliderBarM_mc._xscale = (this.sliderMask_mc._xscale = ((vidTarget._width - sliderDiff) / this.sliderBar_mc.sliderBarM_mc._width) * 100);
this.sliderBar_mc.sliderBarR_mc._x = this.sliderBar_mc.sliderBarM_mc._x + this.sliderBar_mc.sliderBarM_mc._width;
this.sliderMask_mc._visible = true;
this.sliderMask_mc._x = (this.sliderBar_mc._x + this.sliderBar_mc._width) - 2.5;
this.maskScale = this.sliderMask_mc._xscale;
this.preload = setInterval(this, "startLoading", 200);
this.beginDrag = this.sliderBar_mc._x;
this.endDrag = (this.sliderBar_mc._width + this.sliderBar_mc._x) - this.indicatorKnob_mc._width;
};
FVideoControlClass.prototype.getVideoDuration = function () {
var vc_length = (Math.round((this._parent._totalframes / this.vcFPS) * 10) / 10);
if (((vc_length * 10) % 10) == 0) {
vc_length = String(vc_length) + ".0";
}
return(vc_length);
};
FVideoControlClass.prototype.getVideoElapsed = function () {
var vc_position = (Math.round(((this._parent._currentframe / this._parent._totalframes) * (this._parent._totalframes / this.vcFPS)) * 10) / 10);
if (((vc_position * 10) % 10) == 0) {
vc_position = String(vc_position) + ".0";
}
return(vc_position);
};
FVideoControlClass.prototype.getVideoRemaining = function () {
var vc_remaining = (Math.round(((this._parent._totalframes - this._parent._currentframe) / this.vcFPS) * 10) / 10);
if (((vc_remaining * 10) % 10) == 0) {
vc_remaining = String(vc_remaining) + ".0";
}
return(vc_remaining);
};
FVideoControlClass.prototype.playVideo = function () {
this.isPlaying = true;
this._parent.play();
this.play_btn.gotoAndStop(3);
this.play_btn.onRelease = (this.play_btn.onReleaseOutside = this.stopVideo);
this.knobMovement = setInterval(this, "startMoveKnob", 50);
};
FVideoControlClass.prototype.stopVideo = function () {
this.isPlaying = false;
this._parent.stop();
this.play_btn.gotoAndStop(1);
this.play_btn.onRelease = (this.play_btn.onReleaseOutside = this.playVideo);
clearInterval(this.knobMovement);
};
FVideoControlClass.prototype.pauseVideo = function () {
this._parent.stop();
this.play_btn.onRelease = (this.play_btn.onReleaseOutside = this.playVideo);
clearInterval(this.knobMovement);
};
FVideoControlClass.prototype.startFFW = function () {
var frame = (this.controller._parent._currentframe + 6);
if (frame < this.controller._parent._totalframes) {
var interval = Math.floor(1000 / this.controller.vcFPS);
this.controller.pauseVideo();
this.controller._parent.gotoAndStop(frame);
this.controller.movement = setInterval(this.controller, "callBackFFWREW", 35, "FFW");
}
};
FVideoControlClass.prototype.startREW = function () {
var frame = (this.controller._parent._currentframe - 6);
if (frame > 1) {
var interval = Math.floor(1000 / this.controller.vcFPS);
this.controller.pauseVideo();
this.controller._parent.gotoAndStop(frame);
this.controller.movement = setInterval(this.controller, "callBackFFWREW", 35, "REW");
}
};
FVideoControlClass.prototype.removeFFWREW = function () {
if (this.controller.isPlaying) {
this.controller.playVideo();
}
clearInterval(this.controller.movement);
};
FVideoControlClass.prototype.startSliderBar = function () {
this.controller.indicatorKnob_mc.gotoAndStop(2);
this.controller.indicatorKnob_mc._x = (this._xmouse + this._x) - (this.controller.indicatorKnob_mc._width / 2);
var frame = Math.round((this._xmouse / this._width) * this.controller._parent._totalframes);
this.controller._parent.gotoAndStop(frame);
};
FVideoControlClass.prototype.stopSliderBar = function () {
if (this.controller.isPlaying) {
this.controller.playVideo();
}
this.controller.indicatorKnob_mc.gotoAndStop(1);
};
FVideoControlClass.prototype.callBackFFWREW = function (arg) {
if (arg == "FFW") {
var frame = (this._parent._currentframe + (this.vcFPS / 6));
} else {
var frame = (this._parent._currentframe - (this.vcFPS / 6));
}
this._parent.gotoAndStop(frame);
this.startMoveKnob();
updateAfterEvent();
};
FVideoControlClass.prototype.startDragKnob = function () {
this.gotoAndStop(2);
this.lastX = this._xmouse;
this.onMouseMove = this.controller.dragKnob;
if (this.controller.isPlaying) {
this.controller.pauseVideo();
}
};
FVideoControlClass.prototype.dragKnob = function () {
this.knobMove = this._xmouse - this.lastX;
this.knobMove = this.knobMove + this._x;
if (this.knobMove < this.controller.sliderBar_mc._x) {
this.knobMove = this.controller.sliderBar_mc._x;
} else if (this.knobMove > this.controller.endDrag) {
this.knobMove = this.controller.endDrag;
}
this._x = this.knobMove;
var frame = Math.round(((this._x - this.controller.beginDrag) / (this.controller.sliderBar_mc._width - this._width)) * this.controller._parent._totalframes);
this.controller._parent.gotoAndStop(frame);
};
FVideoControlClass.prototype.stopDragKnob = function () {
this.gotoAndStop(1);
this.onMouseMove = null;
if (this.controller.isPlaying) {
if (this.controller._parent._currentframe >= this.controller._parent._totalframes) {
this.controller.videoLoop();
} else {
this.controller.playVideo();
}
}
};
FVideoControlClass.prototype.startMoveKnob = function () {
if (this._parent._currentframe >= this._parent._totalframes) {
this.videoLoop();
}
var newX = ((this._parent._currentframe / this._parent._totalframes) * (this.endDrag - this.beginDrag));
newX = newX + this.beginDrag;
this.indicatorKnob_mc._x = newX;
updateAfterEvent();
};
FVideoControlClass.prototype.videoLoop = function () {
if (!this.vcLoop) {
this.stopVideo();
}
};
FVideoControlClass.prototype.showVolume = function () {
this.controller.attachMovie("volumeClip", "volume_mc", 999);
this.controller.volume_mc._x = (this._x - (this.controller.volume_mc._width / 2)) - 2;
this.controller.volume_mc._y = this._height - this.controller.volume_mc._height;
if (this.controller.videoSound == undefined) {
this.controller.videoSound = new Sound(this.controller._parent);
this.controller.knobH = this.controller.volume_mc.volumeKnob_mc._height;
this.controller.knobStartY = this.controller.volume_mc.volumeKnob_mc._y;
this.controller.barY = this.controller.volume_mc.volumeBar_mc._y;
this.controller.barH = this.controller.volume_mc.volumeBar_mc._height;
} else {
var volume = this.controller.videoSound.getVolume();
this.controller.volume_mc.volumeKnob_mc._y = this.controller.barH - (((this.controller.barH - this.controller.knobH) / 100) * volume);
}
this.controller.onMouseMove = this.controller.startVolumeDrag;
};
FVideoControlClass.prototype.hideVolume = function () {
this.controller.volume_mc.removeMovieClip();
this.controller.onMouseMove = null;
};
FVideoControlClass.prototype.startVolumeDrag = function () {
var mouseX = (this.volume_mc._xmouse + (this.volume_mc._width / 2));
var mouseY = this.volume_mc._ymouse;
if ((((mouseX > 0) && (mouseX < this.volume_mc._width)) && (mouseY > 0)) && (mouseY < this.volume_mc._height)) {
var volume = (100 - Math.round(((this.volume_mc.volumeBar_mc._ymouse - this.barY) / (this.volume_mc.volumeBar_mc._height - this.knobH)) * 100));
if (volume < 0) {
volume = 0;
} else if (volume > 100) {
volume = 100;
}
this.volume_mc.volumeKnob_mc._y = this.barH - (((this.barH - this.knobH) / 100) * volume);
this.videoSound.setVolume(volume);
}
};
FVideoControlClass.prototype.startLoading = function () {
this.bytesLoaded = this._parent.getBytesLoaded();
this.bytesTotal = this._parent.getBytesTotal();
this.progress = Math.floor((this.bytesLoaded / this.bytesTotal) * this.maskScale);
this.sliderMask_mc._xscale = this.maskScale - this.progress;
if ((this.bytesLoaded > 1) && (this.bytesLoaded == this.bytesTotal)) {
this.sliderMask_mc._visible = false;
clearInterval(this.preload);
}
};
FVideoControlClass.prototype.addProperty("duration", FVideoControlClass.prototype.getVideoDuration, null);
FVideoControlClass.prototype.addProperty("elapsed", FVideoControlClass.prototype.getVideoElapsed, null);
FVideoControlClass.prototype.addProperty("remaining", FVideoControlClass.prototype.getVideoRemaining, null);
FVideoControlClass.prototype.addProperty("play", FVideoControlClass.prototype.playVideo, null);
FVideoControlClass.prototype.addProperty("stop", FVideoControlClass.prototype.stopVideo, null);
Object.registerClass("FVidControl", FVideoControlClass);
#endinitclip