Combined Code
frame 1 {
function trim(trimmed) {
var n = trimmed.length;
lfound = false;
while (!lfound) {
n -= 1;
if (trimmed.charAt(n) != ' ') {
lfound = true;
}
}
return trimmed.slice(0, n + 1);
}
setting = trim('-1,2,3,30.00,512,512,1,1,1,1,1,1,1,000000,0,7c7c7c,cccccc,80ff80,000000,1, ');
v_title = trim('KokuAnim1 ');
v_url = trim(' ');
temp = setting.split(',');
delete setting;
tname = new Array('startFlag', 'endAction', 'urlWindow', 'fps', 'width', 'height');
var i = 0;
while (i < 6) {
this['v_' + tname[i]] = Number(temp[i]);
++i;
}
tname = new Array('bslider', 'bvolume', 'bmute', 'btiming', 'bforward', 'brewind', 'preloader');
var i = 0;
while (i < 7) {
this['v_' + tname[i]] = temp[i + 6] == '1';
++i;
}
v_color = '0x' + temp[13];
v_center = temp[14] == '1';
tname = new Array('col1', 'col2', 'col3', 'col4');
var i = 0;
while (i < 4) {
if (temp[i + 15] != '') {
this['v_' + tname[i]] = '0x' + temp[i + 15];
}
++i;
}
v_mUrlWindow = Number(temp[19]);
v_mUrl = temp[20];
delete temp;
delete tname;
_quality = 'BEST';
var v_mleft = 0;
var v_mtop = 0;
var v_mbottom = 15;
var v_mright = 0;
vw = v_width < 275 ? 275 : v_width;
vh = v_height;
var v_twidth = vw + v_mleft + v_mright;
var v_theight = vh + v_mtop + v_mbottom;
stop();
}
movieClip 4 {
}
movieClip 5 {
instance bar of movieClip 4 {
onClipEvent (load) {
_rotation = 180;
}
}
}
movieClip 6 {
}
instance loading_mc of movieClip 6 {
onClipEvent (load) {
var p = _parent;
var t = 0;
var twait = 0.5 * p.v_fps;
var v = 120 / p.v_fps;
var isOn = false;
var r = 180;
var vr = 72 / p.v_fps;
if (!p.v_center) {
_x = p.v_twidth / 2;
_y = p.v_theight / 2;
}
}
onClipEvent (enterFrame) {
++t;
if (isOn) {
_rotation = _rotation - v;
if (r > 0) {
r -= vr;
top.bar._rotation = r;
bottom.bar._rotation = r;
}
if (p._framesloaded > 2 && t > twait) {
p.gotoAndPlay(2);
}
} else {
if (t > twait) {
if (p.v_preloader && p._framesloaded < 2) {
isOn = true;
_alpha = 100;
twait += p.v_fps * 2;
} else {
p.gotoAndPlay(2);
}
}
}
}
}
frame 2 {
function fv_check() {
if (v_loading) {
++t;
fv_setGauge();
if (v_buffstat) {
fv_setBuff();
if (_framesloaded > fwait && t > twait) {
fv_endBuff();
}
} else {
fcheck = _currentframe + v_fps;
if (fcheck > _totalframes) {
fcheck = _totalframes;
}
if (_framesloaded < fcheck) {
fwait = _currentframe + fadd;
if (fwait > _totalframes) {
fwait = _totalframes;
}
fv_initBuff();
}
}
if (_framesloaded >= _totalframes) {
fplay = _totalframes;
v_loading = false;
fv_endBuff();
}
}
if (v_playstat) {
if (_currentframe >= _totalframes) {
if (v_endAction == 2) {
gotoAndPlay(4);
} else {
fv_rewind();
if (v_endAction == 3) {
var window;
if (v_urlWindow == 1) {
window = '_self';
} else {
if (v_urlWindow == 2) {
window = '_blank';
} else {
if (v_urlWindow == 3) {
window = '_parent';
} else {
window = '_top';
}
}
}
getURL(v_url, window);
}
}
}
}
}
function fv_initBuff() {
v_buffstat = true;
t = 0;
fbuff0 = _currentframe;
fv_setBuff();
stop();
}
function fv_setBuff() {
p = (_framesloaded - fbuff0) / (fwait - fbuff0);
if (p >= 0.99) {
p = 0.99;
}
c_stat.setBuff(p);
}
function fv_endBuff() {
v_buffstat = false;
if (v_playstat) {
c_stat.setPlay();
play();
} else {
c_stat.setStop();
}
}
function fv_setGauge() {
f = _framesloaded;
if (f < _totalframes) {
f = Math.max(_currentframe, f - fadd);
}
fplay = Math.max(f, fplay);
c_gauge.setGauge(fplay);
}
function fv_rewind() {
gotoAndStop(4);
fv_play(false);
}
function fv_forward() {
gotoAndStop(fplay);
fv_play(false);
}
function fv_play(cond) {
v_playstat = cond;
c_play.setButton(cond);
if (cond) {
c_stat.setPlay();
if (!v_buffstat) {
play();
}
} else {
c_stat.setStop();
stop();
}
}
function fv_jump(f) {
f += 3;
if (f < 4) {
f = 4;
} else {
if (f > fplay) {
f = fplay;
}
}
gotoAndStop(f);
fv_play(false);
}
function fv_mute(cond) {
v_mute = cond;
c_mute.setButton(cond);
if (cond) {
v_sound.setVolume(0);
} else {
v_sound.setVolume(v_vol);
}
}
function fv_volume(vol) {
v_vol = vol;
if (!v_mute) {
v_sound.setVolume(v_vol);
}
}
var v_playstat = true;
var v_buffstat = true;
var v_loading = true;
var fwait;
var fbuff0;
var fadd = v_fps * 5;
var fplay = 3;
var t = 0;
var twait = v_fps * 3;
if (v_startFlag == 0) {
fwait = 3 + fadd;
v_playstat = false;
} else {
if (v_startFlag == -1) {
fwait = 3 + fadd;
} else {
if (v_startFlag == -2) {
fwait = _totalframes;
} else {
fwait = 3 + v_startFlag * v_fps;
}
}
}
fv_initBuff();
v_sound = new Sound(this);
var v_vol = v_sound.getVolume();
var v_mute = false;
gotoAndStop(3);
}
movieClip 8 {
}
movieClip 10 {
frame 1 {
(new Color(base_mc)).setRGB(_parent.colBase);
}
}
movieClip 12 {
}
movieClip 14 {
}
movieClip 15 {
frame 1 {
function go(pos) {
if (pos < 0) {
pos = 0;
} else {
if (pos > gauge_mc._width) {
pos = gauge_mc._width;
}
}
n = Math.ceil((pos / barWidth) * frames);
p.fv_jump(n);
}
function setSlider() {
line_mc._x = ((p._currentframe - 3) / frames) * barWidth;
}
function setGauge(f) {
gauge_mc._width = ((f - 3) / frames) * barWidth;
}
var barWidth = _parent.pos - _x;
var p = _parent._parent;
var frames = p._totalframes - 3;
base_mc._width = barWidth;
sh_top._width = barWidth;
sh_bottom._width = sh_top._width;
sh_right._x = barWidth;
(new Color(line_mc)).setRGB(_parent.colText);
(new Color(base_mc)).setRGB(_parent.colScreen);
(new Color(gauge_mc)).setRGB(_parent.colLight);
}
instance gauge_mc of movieClip 8 {
onClipEvent (load) {
var p = _parent;
var active = false;
}
onClipEvent (enterFrame) {
if (active) {
p.go(p._xmouse);
}
}
onClipEvent (press) {
active = true;
p.go(p._xmouse);
}
onClipEvent (release, releaseOutside) {
active = false;
}
}
}
movieClip 16 {
frame 1 {
icon = _parent.icon_mc;
col = new Color(icon);
col1 = _parent._parent.colScreen;
col2 = _parent._parent.colLight;
col.setRGB(col1);
this.onPress = function () {
icon._alpha = 60;
col.setRGB(col1);
};
this.onRollOver = function () {
icon._alpha = 100;
col.setRGB(col2);
};
this.onRelease = function () {
icon._alpha = 100;
col.setRGB(col2);
_parent.clicked();
};
this.onDragOut = function () {
icon._alpha = 100;
col.setRGB(col1);
};
this.onRollOut = this.onDragOut;
this.onReleaseOutside = this.onDragOut;
}
}
movieClip 18 {
}
movieClip 19 {
}
movieClip 20 {
frame 1 {
function clicked() {
_parent._parent.fv_rewind();
}
}
instance base_mc of movieClip 16 {
}
}
movieClip 21 {
frame 1 {
function clicked() {
_parent._parent.fv_forward();
}
}
instance base_mc of movieClip 16 {
}
}
movieClip 23 {
}
movieClip 24 {
frame 1 {
function clicked() {
_parent._parent._parent.fv_play(false);
}
}
instance base_mc of movieClip 16 {
}
}
movieClip 25 {
frame 1 {
function clicked() {
_parent._parent._parent.fv_play(true);
}
}
instance base_mc of movieClip 16 {
}
}
movieClip 26 {
frame 1 {
function setButton(cond) {
if (cond) {
gotoAndStop(2);
} else {
gotoAndStop(3);
}
}
colScreen = _parent.colScreen;
colLight = _parent.colLight;
setButton(_parent._parent.v_playstat);
stop();
}
instance b_play of movieClip 24 {
}
}
movieClip 28 {
}
movieClip 30 {
}
movieClip 31 {
frame 1 {
function clicked() {
_parent._parent._parent.fv_mute(true);
}
}
instance base_mc of movieClip 16 {
}
}
movieClip 33 {
}
movieClip 34 {
frame 1 {
function clicked() {
_parent._parent._parent.fv_mute(false);
}
}
instance base_mc of movieClip 16 {
}
}
movieClip 35 {
frame 1 {
function setButton(cond) {
if (cond) {
gotoAndStop(3);
} else {
gotoAndStop(2);
}
}
colScreen = _parent.colScreen;
colLight = _parent.colLight;
stop();
}
}
movieClip 39 {
}
movieClip 41 {
frame 1 {
(new Color(base_mc)).setRGB(_parent._parent.colBase);
}
}
movieClip 42 {
frame 1 {
function setSlider(x) {
bar_mc._width = x;
if (!slider_mc.active) {
slider_mc._x = x;
}
}
function setVol(x) {
if (x < 0) {
x = 0;
} else {
if (x > 35) {
x = 35;
}
}
vol = 100 * x / 35;
setSlider(x);
p.fv_volume(vol);
}
var p = _parent._parent;
var vol = p.v_vol;
(new Color(base_mc)).setRGB(_parent.colScreen);
(new Color(bar_mc)).setRGB(_parent.colLight);
setVol(vol * 0.35);
}
instance slider_mc of movieClip 41 {
onClipEvent (load) {
active = false;
p = _parent;
}
onClipEvent (enterFrame) {
if (active) {
p.setVol(_x);
}
}
onClipEvent (press) {
gotoAndStop(2);
startDrag(this, true, 0, 0, 35, 0);
active = true;
}
onClipEvent (release, releaseOutside) {
gotoAndStop(1);
p.setVol(_x);
active = false;
stopDrag();
}
}
instance area_mc of movieClip 8 {
onClipEvent (load) {
var p = _parent;
var active = false;
}
onClipEvent (enterFrame) {
if (active) {
p.setVol(p._xmouse);
}
}
onClipEvent (press) {
active = true;
p.setVol(p._xmouse);
}
onClipEvent (release, releaseOutside) {
active = false;
}
}
}
movieClip 47 {
frame 1 {
function setPlay() {
gotoAndStop(3);
}
function setStop() {
gotoAndStop(1);
}
function setBuff(p) {
perc = Math.round(p * 100) + '%';
gotoAndStop(2);
}
var perc;
var isPlay;
stop();
}
}
movieClip 49 {
frame 1 {
function setTime() {
t = Math.round((p._currentframe - 3) / fps);
time = getS(t / 60) + ':' + getS(t % 60) + '/' + stotal;
}
function getS(t) {
t = Math.floor(t);
if (t < 10) {
temp = '0' + t;
return temp;
}
temp = String(t);
return temp;
}
var p = _parent._parent;
var fps = p.v_fps;
var total = Math.round((p._totalframes - 3) / fps);
var stotal = getS(total / 60) + ':' + getS(total % 60);
var time = stotal;
setTime();
stop();
}
}
movieClip 52 {
frame 1 {
function animate() {
if (p.v_playstat) {
teks1._x -= v;
teks2._x -= v;
if (teks1._x < tlim) {
teks1._x = teks2._x + l;
}
if (teks2._x < tlim) {
teks2._x = teks1._x + l;
}
}
}
p = _parent._parent;
barWidth = _x - _parent.posl;
bar_mc._width = barWidth;
title = p.v_title;
fps = p.v_fps;
l = teks1.textWidth + 16;
if (l < barWidth) {
teks1._x = -l + 8;
l = barWidth;
} else {
teks1._x = -barWidth;
}
teks1._width = l;
teks2._width = l;
teks2._x = teks1._x + l;
v = 30 / fps;
tlim = -barWidth - l;
if (title != '') {
setInterval(animate, 1000 / fps);
}
}
}
movieClip 53 vc_control {
frame 1 {
var p = _parent;
b_slider._visible = p.v_bslider;
b_volume._visible = p.v_bvolume;
b_mute._visible = p.v_bmute;
t_time._visible = p.v_btiming;
b_forward._visible = p.v_bforward;
b_rewind._visible = p.v_brewind;
var pwidth = p.vw;
pbar_mc._width = pwidth;
var posl = 7;
if (b_rewind._visible) {
posl += 12;
}
b_play._x = posl;
posl += 12;
if (b_forward._visible) {
b_forward._x = posl;
posl += 12;
}
if (b_slider._visible) {
posl -= 5;
b_slider._x = posl;
}
t_stat._x = posl;
posl += 54;
var pos = pwidth;
if (b_mute._visible) {
pos -= 8;
b_mute._x = pos;
pos -= 3;
}
if (b_volume._visible) {
pos -= 41;
b_volume._x = pos;
}
pos -= 5;
t_time._x = pos;
if (t_time._visible) {
t_title._x = pos - 58;
} else {
t_title._x = pos;
}
p.c_stat = t_stat;
p.c_gauge = b_slider;
p.c_play = b_play;
p.c_mute = b_mute;
colBase = _parent.v_col1;
colScreen = _parent.v_col2;
colLight = _parent.v_col3;
colText = _parent.v_col4;
(new Color(t_title)).setRGB(colText);
(new Color(t_stat)).setRGB(colText);
(new Color(t_time)).setRGB(colText);
}
instance b_slider of movieClip 15 {
onClipEvent (enterFrame) {
setSlider();
}
}
instance t_time of movieClip 49 {
onClipEvent (enterFrame) {
setTime();
}
}
}
movieClip 55 vc_area {
}
frame 3 {
attachMovie('vc_control', 'control_mc', 10);
control_mc._y = v_mtop + v_height;
if (v_center) {
control_mc._x = -vw / 2;
control_mc._y -= v_height / 2;
}
setInterval(fv_check, 1000 / v_fps);
if (v_mUrl != '') {
attachMovie('vc_area', 'area_mc', 9);
area_mc._width = vw;
area_mc._height = vh;
area_mc._x = v_mleft;
area_mc._y = v_mtop;
area_mc.onRelease = function () {
var w;
if (v_mUrlWindow == 1) {
w = '_self';
} else {
if (v_mUrlWindow == 2) {
w = '_blank';
} else {
if (v_mUrlWindow == 3) {
w = '_parent';
} else {
w = '_top';
}
}
}
getURL(v_mUrl, w);
};
if (v_center) {
area_mc._x -= vw / 2;
area_mc._y -= vh / 2;
}
}
gotoAndStop(4);
}