Frame 1
_global.g_flvURL = undefined;
_global.g_fps = 24;
_global.g_videoWidth = 385;
_global.g_videoHeight = 310;
_global.g_initilized = undefined;
_global.g_autoPlay = true;
_global.g_autoRewind = true;
_global.g_repeat = true;
initPlayer();
Symbol 18 MovieClip Frame 1
_x = 0;
_x = 0;
_y = 0;
_y = 0;
var w = Stage.width;
var marginBottom = (_root.player.control._y - (vb_b._y + vb_b._height));
var h = ((Stage.height - _root.player.control._height) - marginBottom);
vb_tl._x = 0;
vb_tl._y = 0;
vb_bl._x = 0;
vb_bl._y = h - vb_bl._height;
vb_l._x = 0;
vb_l._y = vb_tl._y + vb_tl._height;
vb_l._height = (h - vb_tl._height) - vb_bl._height;
vb_t._x = vb_tl._x + vb_tl._width;
vb_t.y = 0;
vb_t._width = (Stage.width - vb_tl._width) - vb_tr._width;
vb_tr._x = Stage.width - vb_tr._width;
vb_tr._y = 0;
vb_br._x = Stage.width - vb_br._width;
vb_br._y = h - vb_br._height;
vb_r._x = Stage.width - vb_r._width;
vb_r._y = vb_tr._y + vb_tr._height;
vb_r._height = (h - vb_tr._height) - vb_br._height;
vb_b._x = vb_bl._x + vb_bl._width;
vb_b._y = (vb_bl._y + vb_bl._height) - vb_b._height;
vb_b._width = (Stage.width - vb_bl._width) - vb_br._width;
if (_global.g_clickURL != undefined) {
var vb_dummy = createEmptyMovieClip("vb_dummy", getNextHighestDepth());
var width = (vb_r._x - (vb_l._x + vb_l._width));
var height = (vb_b._y - (vb_t._y + vb_t._height));
vb_dummy._x = vb_l._x + vb_l._width;
vb_dummy._y = vb_t._y + vb_t._height;
vb_dummy.beginFill(16711680, 0);
vb_dummy.moveTo(0, 0);
vb_dummy.lineTo(width, 0);
vb_dummy.lineTo(width, height);
vb_dummy.lineTo(0, height);
vb_dummy.lineTo(0, 0);
vb_dummy.endFill();
vb_dummy.onRelease = function () {
getURL (_global.g_clickURL, ((_global.g_clickURLTarget == undefined) ? "" : (_global.g_clickURLTarget)));
};
}
Symbol 41 MovieClip Frame 1
function syncIndicatorWithVideo() {
if (isDragging) {
return(undefined);
}
var _local4 = ((vt_right._x + vt_right._width) - vt_left._x) - vt_ind._width;
var _local3;
if (!playFLV()) {
_local3 = (vt_ind._width / 2) + ((_local4 * (_root._currentframe - 1)) / Math.max(1, _root._totalframes - 1));
} else if (_global.g_totalTime != undefined) {
var _local5 = Math.min(_global.g_netStream.time, _global.g_totalTime);
_local3 = (vt_ind._width / 2) + (_local4 * (_local5 / _global.g_totalTime));
} else {
_local3 = vt_ind._width / 2;
}
vt_ind._x = vt_left._x + _local3;
vt_progress._x = vt_left._x;
vt_progress._width = _local3 + (vt_ind._width / 2);
syncTimeWithVidio();
}
function formatTimeElement(e) {
var _local1 = String(e);
if (e < 10) {
_local1 = "0" + _local1;
}
return(_local1);
}
function formatTime(time) {
h = int(time / 3600);
m = int((time / 60) % 60);
s = int(time % 60);
var _local1 = (formatTimeElement(m) + ":") + formatTimeElement(s);
if (h > 0) {
_local1 = (formatTimeElement(h) + ":") + _local1;
}
return(_local1);
}
function syncTimeWithVidio() {
if (playFLV() && (_global.g_totalTime == undefined)) {
return(undefined);
}
var _local3;
var _local4;
if (!playFLV()) {
if (_global.g_fps != undefined) {
_local4 = Math.ceil(_root._currentframe / _global.g_fps);
_local3 = Math.ceil(_root._totalframes / _global.g_fps);
}
} else if (_global.g_totalTime != undefined) {
_local4 = Math.min(_global.g_totalTime, Math.round(_global.g_netStream.time));
_local3 = _global.g_totalTime;
}
if ((_local3 != undefined) && (_local4 != undefined)) {
text = (formatTime(_local4) + " / ") + formatTime(_local3);
}
time.text = text;
}
function seekToMousePos(x) {
var _local4 = ((vt_right._x + vt_right._width) - vt_left._x) - vt_ind._width;
var _local3 = (x - vt_left._x) - (vt_ind._width / 2);
if (_local3 < 0) {
_local3 = 0;
}
if (!playFLV()) {
var _local5 = Math.min(_root._totalframes, Math.round((_local3 * (_root._totalframes + 1)) / _local4) + 1);
changeCurrentFrame(_local5);
syncTimeWithVidio();
} else {
var _local6 = (_local3 * _global.g_totalTime) / _local4;
changeCurrentFrame(_local6);
syncTimeWithVidio();
}
}
var isDragging = false;
var vt_dummy = createEmptyMovieClip("vt_dummy", getNextHighestDepth());
var width = ((vt_right._x + vt_right._width) - vt_left._x);
var height = vt_center._height;
_loc2 = (x - vt_left._x) - (vt_ind._width / 2);
time._x = (vt_center._x + vt_center._width) + 8;
sjbeijin._x = (vt_center._x + vt_center._width) + 8;
vt_dummy._x = vt_left._x;
vt_dummy._y = vt_left._y;
vt_dummy.beginFill(16711680, 0);
vt_dummy.moveTo(0, 0);
vt_dummy.lineTo(width, 0);
vt_dummy.lineTo(width, height);
vt_dummy.lineTo(0, height);
vt_dummy.lineTo(0, 0);
vt_dummy.endFill();
vt_ind.swapDepths(1);
vt_ind.onPress = function () {
if (playFLV() && (!_global.g_flvLoaded)) {
return(undefined);
}
isDragging = true;
if (_global.g_isPlaying) {
if (!playFLV()) {
_root.stop();
} else {
_global.g_netStream.pause(true);
}
}
startDrag (this, false, vt_left._x + (vt_ind._width / 2), vt_ind._y, ((vt_right._x + vt_right._width) - (vt_ind._width / 2)) + 1, vt_ind._y);
};
vt_ind.onRelease = (vt_ind.onReleaseOutside = function () {
isDragging = false;
stopDrag();
if (_global.g_isPlaying) {
if (!playFLV()) {
_root.play();
} else {
_global.g_netStream.pause(false);
}
}
});
vt_ind.onMouseMove = function () {
if (!isDragging) {
return(undefined);
}
seekToMousePos(vt_ind._x);
};
vt_dummy.onPress = function () {
if (playFLV() && (!_global.g_flvLoaded)) {
return(undefined);
}
var _local2 = _xmouse;
seekToMousePos(_local2);
};
Symbol 43 MovieClip Frame 1
stop();
onRollOver = function () {
gotoAndPlay (2);
};
onReleaseOutside = (onRollOut = function () {
this.gotoAndPlay(7);
});
Symbol 43 MovieClip Frame 6
stop();
Symbol 43 MovieClip Frame 12
stop();
Symbol 45 MovieClip Frame 1
stop();
onRollOver = function () {
this.gotoAndPlay(2);
};
onReleaseOutside = (onRollOut = function () {
this.gotoAndPlay(7);
});
Symbol 45 MovieClip Frame 6
stop();
Symbol 45 MovieClip Frame 12
stop();
Symbol 46 MovieClip Frame 1
stop();
onRollOver = function () {
s1.gotoAndPlay(2);
};
onReleaseOutside = (onRollOut = function () {
s1.gotoAndPlay(6);
});
Symbol 46 MovieClip Frame 2
stop();
onRollOver = function () {
s2.gotoAndPlay(2);
};
onReleaseOutside = (onRollOut = function () {
s2.gotoAndPlay(6);
});
Symbol 56 MovieClip Frame 1
function syncIndicator() {
var _local4 = track._width - ind._width;
var _local2 = (ind._x - track._x) - (ind._width / 2);
if (_local2 < 0) {
_local2 = 0;
}
var _local3 = Math.min(100, Math.max(0, (_local2 / _local4) * 100));
progress._x = 0;
progress._width = (track._width * _local3) / 100;
_global.g_soundVolume = _local3;
if (!_global.g_soundMute) {
_global.g_soundObj.setVolume(_local3);
}
}
var isDragging = false;
ind._x = (track._x + track._width) - (ind._width / 2);
syncIndicator();
var dummy = createEmptyMovieClip("dummy", getNextHighestDepth());
var width = track._width;
var height = track._height;
dummy._x = track._x;
dummy._y = track._y;
dummy.beginFill(16711680, 0);
dummy.moveTo(0, 0);
dummy.lineTo(width, 0);
dummy.lineTo(width, height);
dummy.lineTo(0, height);
dummy.lineTo(0, 0);
dummy.endFill();
ind.swapDepths(1);
ind.onPress = function () {
isDragging = true;
startDrag (this, false, ind._width / 2, ind._y, track._width - (ind._width / 2), ind._y);
};
ind.onRelease = (ind.onReleaseOutside = function () {
isDragging = false;
stopDrag();
});
ind.onMouseMove = function () {
if (!isDragging) {
return(undefined);
}
syncIndicator();
};
dummy.onPress = function () {
ind._x = Math.max(track._x + (ind._width / 2), Math.min((track._x + track._width) - (ind._width / 2), _xmouse));
syncIndicator();
};
Symbol 61 MovieClip Frame 1
stop();
Symbol 61 MovieClip Frame 3
stop();
Symbol 61 MovieClip Frame 5
stop();
Symbol 65 MovieClip Frame 1
stop();
Symbol 65 MovieClip Frame 3
stop();
Symbol 65 MovieClip Frame 5
stop();
Symbol 66 MovieClip Frame 1
stop();
onRollOver = function () {
p1.gotoAndPlay(2);
};
onReleaseOutside = (onRollOut = function () {
p1.gotoAndPlay(6);
});
Symbol 66 MovieClip Frame 2
stop();
onRollOver = function () {
p2.gotoAndPlay(2);
};
onReleaseOutside = (onRollOut = function () {
p2.gotoAndPlay(6);
});
Symbol 67 MovieClip Frame 1
_x = 0;
_x = 0;
_y = (Stage.height - _height);
_y = (Stage.height - _height);
var atMarginRight = (cb_right._x - at._x);
var bSoundMarginRight = (cb_right._x - b_sound._x);
var vtRightMarginRight = (cb_right._x - vt.vt_right._x);
cb_left._x = 0;
cb_right._x = Stage.width - cb_right._width;
cb_center._x = (cb_left._x + cb_left._width) - 1;
cb_center._width = (cb_right._x - cb_center._x) + 2;
at._x = cb_right._x - atMarginRight;
b_sound._x = cb_right._x - bSoundMarginRight;
vt.vt_right._x = cb_right._x - vtRightMarginRight;
vt.vt_center._x = (vt.vt_left._x + vt.vt_left._width) - 1;
vt.vt_center._width = (vt.vt_right._x - vt.vt_center._x) + 2;
vt.vt_ind._x = vt.vt_left._x + (vt.vt_ind._width / 2);
b_play.onRelease = function () {
if (!playFLV()) {
if (!_global.g_isPlaying) {
_root.play();
} else {
_root.stop();
}
} else {
if (!_global.g_flvLoaded) {
return(undefined);
}
if (!_global.g_isPlaying) {
if (!_global.g_autoPlay) {
_global.g_autoPlay = true;
_global.g_netStream.pause(false);
}
if (_global.g_isEnd) {
changeCurrentFrame(0);
}
_global.g_netStream.pause(false);
_global.g_isPlaying = true;
} else {
_global.g_netStream.pause(true);
_global.g_isPlaying = false;
}
}
};
b_stop.onRelease = function () {
_root.as.myfun();
if (!playFLV()) {
_root.g_currentFrame = 1;
_root.gotoAndStop(1);
} else {
if (!_global.g_flvLoaded) {
return(undefined);
}
changeCurrentFrame(0);
_global.g_netStream.pause(true);
_global.g_isPlaying = false;
}
};
b_backward.onRelease = function () {
if (!playFLV()) {
var _local4 = _root._currentframe - _root.g_seekStep;
if (_local4 < 1) {
_local4 = 1;
}
changeCurrentFrame(_local4);
} else {
if (!_global.g_flvLoaded) {
return(undefined);
}
var _local3 = _global.g_netStream.time - _global.g_seekStep;
if (_local3 < 0) {
_local3 = 0;
}
changeCurrentFrame(_local3);
}
};
b_forward.onRelease = function () {
if (!playFLV()) {
var _local3 = _root._currentframe + _root.g_seekStep;
if (_local3 > _root._totalframes) {
_local3 = _root._totalframes;
}
changeCurrentFrame(_local3);
} else {
if (!_global.g_flvLoaded) {
return(undefined);
}
var _local4 = _global.g_netStream.time + _global.g_seekStep;
if (_local4 > _global.g_totalTime) {
_local4 = _global.g_totalTime;
}
changeCurrentFrame(_local4);
}
};
b_sound.onRelease = function () {
_global.g_soundMute = !_global.g_soundMute;
b_sound.gotoAndStop((_global.g_soundMute ? 2 : 1));
var _local2;
if (!_global.g_soundMute) {
_local2 = _global.g_soundVolume;
} else {
_local2 = 0;
}
_global.g_soundObj.setVolume(_local2);
};
Symbol 69 MovieClip Frame 1
function myfun() {
trace("myfun");
}
_global.g_initilized;
_global.g_flvLoaded;
_global.g_netConnection;
_global.g_netStream;
_global.g_totalTime;
_global.g_seekStep;
_global.g_soundObj;
_global.g_soundVolume;
_global.g_soundMute;
_global.g_currentFrame;
_global.g_isPlaying;
_global.g_isEnd;
_global.playFLV = function () {
return((_global.g_flvVariable != undefined) || (_global.g_flvURL != undefined));
};
_global.StartPlayFLV = function () {
_global.g_netConnection = new NetConnection();
_global.g_netConnection.connect(null);
_global.g_netStream = new NetStream(_global.g_netConnection);
_root.player.g_videoObj.attachVideo(_global.g_netStream);
_global.g_netStream.setBufferTime(5);
_global.g_netStream.play(_global.g_flvURL);
};
_global.initPlayer = function () {
if (_global.g_initilized == undefined) {
_global.g_flvLoaded = false;
_global.g_isPlaying = false;
_global.g_isEnd = false;
_global.g_soundObj = new Sound();
_global.g_soundVolume = _global.g_soundObj.getVolume();
_global.g_soundMute = false;
if (_global.g_flvVariable != undefined) {
_global.g_flvURL = eval (_global.g_flvVariable);
}
if (!playFLV()) {
_global.g_currentFrame = _root._currentframe;
_global.g_seekStep = int(_root._totalframes / 20);
if (_global.g_seekStep < 50) {
_global.g_seekStep = 50;
}
_root.onEnterFrame = function () {
if (!_root.player.control.vt.isDragging) {
_global.g_isPlaying = _global.g_currentFrame != _root._currentframe;
_global.g_currentFrame = _root._currentframe;
}
var _local3 = _global.g_isEnd;
_global.g_isEnd = _root._currentframe == _root._totalframes;
if (_global.g_isEnd) {
if (((_global.g_endURL != undefined) && (!_local3)) && (_global.g_isEnd)) {
getURL (_global.g_endURL, ((_global.g_endURLTarget == undefined) ? "" : (_global.g_endURLTarget)));
}
}
if (_global.g_isEnd && (!_root.player.control.vt.isDragging)) {
if (_global.g_isPlaying) {
if (!(_global.g_autoRewind || (_global.g_repeat))) {
_global.g_isPlaying = false;
_root.stop();
} else if (!_global.g_repeat) {
changeCurrentFrame(1);
_global.g_isPlaying = false;
_root.stop();
} else {
changeCurrentFrame(2);
_root.play();
}
}
}
updateControls();
};
if (!_global.g_autoPlay) {
_global.g_autoPlay = true;
_root.stop();
}
} else {
if (_global.g_flvURL != undefined) {
_root.player.control.vt.time.text = "Streaming...";
_global.g_currentTime = 0;
_global.g_netConnection = new NetConnection();
_global.g_netConnection.connect(null);
_global.g_netStream = new NetStream(_global.g_netConnection);
_root.player.g_videoObj.attachVideo(_global.g_netStream);
_global.g_netStream.setBufferTime(5);
_global.g_netStream.play(_global.g_flvURL);
_global.g_netStream.onStatus = function (infoObj) {
switch (infoObj.code) {
case "NetStream.Play.Start" :
_global.g_flvLoaded = true;
_root.player.g_videoObj._width = _global.g_videoWidth;
_root.player.g_videoObj._height = _global.g_videoHeight;
if (!_global.g_autoPlay) {
_global.g_netStream.pause(true);
_global.g_netStream.seek(0);
_global.g_isPlaying = false;
} else {
_global.g_isPlaying = true;
}
break;
case "NetStream.Buffer.Full" :
break;
case "NetStream.Play.Stop" :
break;
case "NetStream.Seek.InvalidTime" :
_global.g_netStream.seek(infoObj.details);
break;
case "NetStream.Play.StreamNotFound" :
_root.player.control.vt.time.text = "Stream not found.";
var _local3 = new TextFormat();
_local3.color = 16711680 /* 0xFF0000 */;
_root.player.control.vt.time.setTextFormat(_local3);
}
};
_global.g_netStream.onMetaData = function (infoObj) {
_global.g_totalTime = Math.floor(infoObj.duration);
_global.g_seekStep = _global.g_totalTime / 20;
if (_global.g_seekStep < 5) {
_global.g_seekStep = 5;
}
};
} else {
_root.player.control.vt.time.text = ("\"" + _global.g_flvVariable) + "\" not defined.";
var fmt = new TextFormat();
fmt.color = 16711680 /* 0xFF0000 */;
_root.player.control.vt.time.setTextFormat(fmt);
}
_root.onEnterFrame = function () {
if (_global.g_totalTime != undefined) {
var _local3 = _global.g_isEnd;
_global.g_isEnd = _global.g_netStream.time >= _global.g_totalTime;
if (((_global.g_endURL != undefined) && (!_local3)) && (_global.g_isEnd)) {
getURL (_global.g_endURL, ((_global.g_endURLTarget == undefined) ? "" : (_global.g_endURLTarget)));
}
}
if (_global.g_isEnd && (!_root.player.control.vt.isDragging)) {
if (_global.g_isPlaying) {
if (!(_global.g_autoRewind || (_global.g_repeat))) {
_global.g_isPlaying = false;
_global.g_netStream.pause(true);
} else {
changeCurrentFrame(0);
if (!_global.g_repeat) {
_global.g_isPlaying = false;
_global.g_netStream.pause(true);
} else {
_global.g_netStream.pause(false);
}
}
}
}
updateControls();
};
}
_global.g_initilized = true;
}
};
_global.changeCurrentFrame = function (pos) {
if (!playFLV()) {
if (!((_global.g_isPlaying && (!_root.player.control.vt.isDragging)) && (pos < _root._totalframes))) {
_global.g_currentFrame = pos;
_root.gotoAndStop(pos);
} else {
_global.g_currentFrame = 0;
_root.gotoAndPlay(pos);
}
} else {
_global.g_netStream.seek(pos);
}
};
_global.updateControls = function () {
_root.player.control.b_play.gotoAndStop((_global.g_isPlaying ? 2 : 1));
_root.player.control.vt.syncIndicatorWithVideo();
};
Symbol 72 Button
on (release) {
getURL ("http://ultraflash.net", "_blank");
}