CODE
// [Action in Frame 1]
locker._visible = false;
locker.onPress = function ()
{
};
locker.useHandCursor = false;
var big_size;
var stageResize = function (ww, hh)
{
var _loc4 = 17;
var _loc6 = 226;
var _loc3 = _loc4 + _loc6 + 1000;
this._x = 0;
if (ww > _loc3)
{
this._x = Math.round((ww - _loc3) / 2);
ww = _loc3;
}
else if (ww < 831)
{
ww = 831;
} // end else if
big_size = ww - _loc4 - _loc6;
side_R._x = ww;
side_T._width = ww - 464;
side_B._width = ww - 464;
var _loc5 = Math.round(big_size / 2 + _loc4);
forw_T._x = _loc5;
forw_B._x = _loc5;
var _loc7 = Math.round(big_size / 1000 * 100);
forw_B.sub.msk1._xscale = _loc7;
forw_B.sub.msk1._width = Math.round(forw_B.sub.msk1._width);
if (forw_B.sub.msk1._width + forw_B.sub.msk1._x > 150)
{
forw_B.sub.msk1._x = 150 - forw_B.sub.msk1._width;
} // end if
forw_B.sub.bor_L._x = Math.round(forw_B.sub.msk1._x);
forw_B.sub.bor_R._x = Math.round(forw_B.sub.msk1._x + forw_B.sub.msk1._width);
big_bg.msk._width = big_size;
if (big_size > 1000 + big_bg.item._x)
{
big_bg.repos();
} // end if
if (locker._visible == true)
{
locker._width = side_R._x;
if (confirm_mc != undefined)
{
confirm_mc._x = int(Stage.width / 2 - _x);
} // end if
} // end if
};
stageResize(Stage.width, Stage.height);
forw_T.txt.autoSize = true;
forw_T.txt.text = _root.myTownTitle;
var www = int(forw_T.txt._width / 2);
forw_T.txt._x = -www - 1;
forw_T.tt_1._x = -www - 30;
forw_T.tt_2._x = -www;
forw_T.tt_2._width = www * 2;
forw_T.tt_3._x = www;
var hh = 19;
var max_hh = 251;
var cur_hh = 0;
var scr_hh = 256;
var wrk_hh = 0;
var sub_y = side_R.sub._y;
var ftime = Number(_parent.myTownClips.ftime);
var ftime_max = Number(_parent.myTownClips.ftime_max);
if (isNaN(ftime))
{
ftime = 20;
} // end if
if (isNaN(ftime_max))
{
ftime_max = 10;
} // end if
var ltime;
var ltime_fin;
var ltime_start;
var ltime_cur;
var zf2 = function (n)
{
return ((n < 10 ? ("0") : ("")) + String(n));
};
var time2str = function (ttm)
{
var _loc5 = "";
var _loc3 = Math.floor(ttm / 3600);
ttm = ttm - _loc3 * 60 * 60;
var _loc2 = Math.floor(ttm / 60);
ttm = ttm - _loc2 * 60;
var _loc4 = ttm;
return (zf2(_loc3) + ":" + zf2(_loc2) + ":" + zf2(_loc4));
};
var timer_done = function (Void)
{
clearInterval(timer_IV);
side_R.move_mc.timer_bar._xscale = 0;
side_R.move_mc.timer_txt.text = "ïåðåõîä âîçìîæåí";
side_R.move_mc.timer_time.text = "00:00:00";
};
var timer_IV;
var timer_fu = function (Void)
{
var _loc1 = new Date().getTime();
if (_loc1 <= ltime_fin)
{
side_R.move_mc.timer_time.text = time2str(int((ltime_fin - _loc1 + 999) / 1000));
side_R.move_mc.timer_bar._xscale = Math.min(100, 100 - (_loc1 - ltime_start) / (ltime_fin - ltime_start) * 100);
}
else
{
timer_done();
} // end else if
};
if (_root.zzz == "1")
{
ftime = ftime_max = 0;
} // end if
if (ftime_max == 0)
{
timer_done();
side_R.move_mc._visible = false;
}
else
{
max_hh = max_hh - 51;
scr_hh = scr_hh - 51;
side_R.scr_mc.scr_down._y = side_R.scr_mc.scr_down._y - 51;
side_R.scr_mc.sub.bg._height = side_R.scr_mc.sub.bg._height - 51;
side_R.scr_msk._height = side_R.scr_msk._height - 38;
var delta = (ftime_max - ftime) * 1000;
ltime = new Date().getTime();
ltime_start = ltime - delta;
ltime_cur = ltime;
ltime_fin = ltime + ftime * 1000;
timer_IV = setInterval(timer_fu, 500);
timer_fu();
} // end else if
big_bg.repos = function ()
{
big_bg.item._x = -Math.floor((1000 - big_size) * (forw_B.sub.msk1._width >= 150 ? (0) : (forw_B.sub.msk1._x / (150 - forw_B.sub.msk1._width))));
big_bg.item_sky._x = big_bg.item._x * 5.000000E-001;
};
forw_B.sub.msk1.onPress = function ()
{
this.min_x = 0;
this.max_x = Math.round(150 - this._width);
this.delta_x = Math.round(this._parent._xmouse - this._x);
this.onEnterFrame = function ()
{
var _loc2 = Math.round(this._parent._xmouse - this.delta_x);
if (_loc2 > this.max_x)
{
_loc2 = this.max_x;
}
else if (_loc2 < this.min_x)
{
_loc2 = this.min_x;
} // end else if
this._x = _loc2;
this._parent.bor_R._x = Math.round(this._x + this._width);
this._parent.bor_L._x = _loc2;
big_bg.repos();
};
};
forw_B.sub.msk1.onRelease = function ()
{
delete this.onEnterFrame;
};
forw_B.sub.msk1.onRollOver = function ()
{
forw_B.hint.cshow();
};
forw_B.sub.msk1.onRollOut = function ()
{
forw_B.hint.chide();
};
forw_B.sub.msk1.onReleaseOutside = function ()
{
forw_B.sub.msk1.onRollOut();
forw_B.sub.msk1.onRelease();
};
if (forw_B.sub.msk1._width < 150)
{
forw_B.sub.msk1._x = (150 - forw_B.sub.msk1._width) / 2;
forw_B.sub.bor_R._x = Math.round(forw_B.sub.msk1._x + forw_B.sub.msk1._width);
forw_B.sub.bor_L._x = Math.round(forw_B.sub.msk1._x);
big_bg.repos();
} // end if
side_R.mvb.onRollOver = function ()
{
this.lnk = forw_B.sub.msk1;
this.max_x = Math.round(150 - this.lnk._width);
this.onEnterFrame = function ()
{
if (this.lnk._x < this.max_x)
{
++this.lnk._x;
this.lnk._parent.bor_R._x = Math.round(this.lnk._x + this.lnk._width);
this.lnk._parent.bor_L._x = this.lnk._x;
big_bg.repos();
}
else
{
this.lnk._x = this.max_x;
delete this.onEnterFrame;
} // end else if
};
this._parent.btn_fog._visible = false;
side_R.hint.cshow();
};
side_R.mvb.onRollOut = function ()
{
delete this.onEnterFrame;
this._parent.btn_fog._visible = true;
side_R.hint.chide();
};
side_R.mvb.onReleaseOutside = side_R.mvb.onRelease;
side_L.mvb.onRollOver = function ()
{
this.lnk = forw_B.sub.msk1;
this.min_x = 0;
this.onEnterFrame = function ()
{
if (this.lnk._x > this.min_x)
{
--this.lnk._x;
this.lnk._parent.bor_R._x = Math.round(this.lnk._x + this.lnk._width);
this.lnk._parent.bor_L._x = this.lnk._x;
big_bg.repos();
}
else
{
this.lnk._x = this.min_x;
delete this.onEnterFrame;
} // end else if
};
this._parent.btn_fog._visible = false;
side_L.hint.cshow();
};
side_L.mvb.onRollOut = function ()
{
delete this.onEnterFrame;
this._parent.btn_fog._visible = true;
side_L.hint.chide();
};
side_L.mvb.onReleaseOutside = side_L.mvb.onRelease;
big_bg.item.createEmptyMovieClip("D0", 0);
big_bg.item.createEmptyMovieClip("D1", 1);
var mcl1 = new MovieClipLoader();
var lis1 = {};
lis1.onLoadStart = function (tar)
{
};
lis1.onLoadComplete = function (tar)
{
};
lis1.onLoadInit = function (tar)
{
++partsLoaded;
partsDatas[tar][0] = partsDatas[tar][1];
if (partsLoaded == partsTotal)
{
createList();
delete loader.onEnterFrame;
loader._visible = false;
big_bg._visible = true;
forw_B._visible = true;
mcl1.removeListener(lis1);
mcl1.loadClip(_parent.myTownClips.sky, big_bg.item_sky.item.i2);
} // end if
};
lis1.onLoadProgress = function (tar, bt_loaded, bt_total)
{
};
mcl1.addListener(lis1);
big_bg._visible = false;
forw_B._visible = false;
var partsLoaded = 0;
var partsTotal = 4;
trace (_parent.myTownClips.bg);
if (_url.substr(0, 5) != "file:")
{
_parent.myTownClips.bg = _parent.myTownClips.bg + "?new1";
} // end if
mcl1.loadClip(_parent.myTownClips.bg, big_bg.item.D0);
mcl1.loadClip(_parent.myTownClips.sky, big_bg.item_sky.item.i1);
mcl1.loadClip(_parent.myTownClips.s1, forw_B.sub.i1);
mcl1.loadClip(_parent.myTownClips.s2, forw_B.sub.i2);
loader.ar = [big_bg.item.D0, big_bg.item_sky.item.i1, big_bg.item_sky.item.i2, forw_B.sub.i1, forw_B.sub.i2];
loader.onEnterFrame = function (Void)
{
var _loc4 = 0;
var _loc3 = 0;
for (var _loc5 in this.ar)
{
var _loc2 = mcl1.getProgress(this.ar[_loc5]);
if (_loc2.bytesTotal > 0)
{
_loc4 = _loc4 + _loc2.bytesLoaded;
_loc3 = _loc3 + _loc2.bytesTotal;
continue;
} // end if
_loc3 = _loc3 + 30000;
} // end of for...in
this.i._xscale = _loc4 / _loc3 * 100;
this.pct.text = Math.floor(this.i._xscale);
};
var re_scroll = function (Void)
{
trace (-(side_R.sub._y - sub_y) / (cur_hh - max_hh));
side_R.scr_mc.sub.item._y = -(side_R.sub._y - sub_y) / (cur_hh - max_hh) * wrk_hh;
};
var mlis = {};
mlis.onMouseWheel = function (delta)
{
if (side_R.sub.hitTest(_xmouse, _ymouse))
{
if (delta > 0)
{
side_R.scr_mc.scr_up.onPress();
}
else
{
side_R.scr_mc.scr_down.onPress();
} // end if
} // end else if
};
Mouse.addListener(mlis);
var createList = function (Void)
{
var _loc14;
var l;
for (var _loc10 = 0; _loc10 <= 30; ++_loc10)
{
big_bg.item.D0["anim_" + _loc10]._visible = false;
big_bg.item.D0["anim_" + _loc10].gotoAndStop(1);
} // end of for
var _loc13;
var yy = 0;
for (var _loc12 = 0; _loc12 < _parent.myTownItems.length; ++_loc12)
{
var _loc6 = _parent.myTownItems[_loc12];
var _loc5 = big_bg.item.D0["anim_" + _loc6.id];
var _loc4 = big_bg.item.D0["sen_" + _loc6.id];
if (_loc6.name != undefined)
{
_loc14 = side_R.sub.getNextHighestDepth();
l = side_R.sub.attachMovie("side_R_item", "i" + _loc14, _loc14, {_y: yy});
_loc13 = false;
l.txt.txt.autoSize = true;
l.txt.txt.text = _loc6.name;
l.bg._width = l.txt.txt._width + 5;
if (l.bg._width > 146)
{
l.bg._width = 146;
} // end if
l.Item = _loc6;
l.anim_lnk = _loc5;
l.href = _loc6.href;
l.confirm = _loc6.confirm;
if (l.txt.txt._width > 146)
{
_loc13 = true;
var _loc7 = l.createEmptyMovieClip("mask", l.getNextHighestDepth());
_loc7._x = 18;
_loc7.lineStyle(1, 0, 0);
_loc7.beginFill(0, 50);
_loc7.lineTo(145, 0);
_loc7.lineTo(145, 18);
_loc7.lineTo(0, 18);
_loc7.endFill();
l.txt.setMask(_loc7);
l.txt.txt1.autoSize = true;
l.txt.txt1.text = l.txt.txt.text;
l.txt.txt1._x = l.txt.txt._width + 5;
}
else
{
l.txt.txt1._visible = false;
} // end else if
}
else
{
l = undefined;
} // end else if
if (_loc5 != undefined)
{
_loc5.fu1 = function ()
{
if (this.fin != true)
{
this.gotoAndPlay("p1");
}
else
{
delete this.fin;
this.gotoAndStop(1);
} // end else if
};
if (l != undefined)
{
_loc4.l = l;
_loc4.onRelease = function ()
{
this.l.onRelease();
};
}
else
{
_loc4.href = _loc6.href;
_loc4.onRelease = function ()
{
getURL(this.href, "");
};
} // end else if
if (l != undefined)
{
_loc4.yy = yy;
}
else
{
_loc4.yy = -100;
} // end else if
_loc4.sel_lnk = side_R.sub.sel;
_loc4.anim_lnk = _loc5;
_loc5._alpha = 0;
_loc5._visible = false;
_loc5.gotoAndStop(1);
if (_loc13 == true)
{
_loc4.long = l.txt;
} // end if
_loc4.onRollOver = function ()
{
this.sel_lnk._y = this.yy;
this.anim_lnk.play();
this.anim_lnk._visible = true;
this.anim_lnk.onEnterFrame = function ()
{
this._alpha = this._alpha + 20;
if (this._alpha >= 100)
{
this._alpha = 100;
delete this.onEnterFrame;
} // end if
};
if (this.long != undefined)
{
this.long.run_text();
} // end if
};
_loc4.onRollOut = function ()
{
this.anim_lnk.onEnterFrame = function ()
{
this._alpha = this._alpha - 20;
if (this._alpha <= 0)
{
this._alpha = 0;
this._visible = false;
this.gotoAndStop(1);
delete this.onEnterFrame;
} // end if
};
if (this.long != undefined)
{
this.long.hold_text();
} // end if
};
_loc4.onReleaseOutside = _loc4.onRollOut;
var _loc11 = false;
if (_root.nub == "1")
{
if (_parent.myTownClips.swf_file == "1.swf")
{
if (_loc6.id == 5)
{
_loc11 = true;
} // end if
} // end if
if (_parent.myTownClips.swf_file == "2.swf")
{
if (_loc6.id == 7)
{
_loc11 = true;
} // end if
} // end if
} // end if
if (_loc11 == true)
{
_loc4.onRollOver = undefined;
_loc4.onRollOut = undefined;
_loc5._visible = true;
_loc5._alpha = 0;
_loc5.delta = 10;
_loc5.onEnterFrame = function ()
{
this._alpha = this._alpha + this.delta;
if (this.delta > 0 && this._alpha >= 100)
{
this.delta = -10;
this._alpha = 100;
}
else if (this.delta < 0 && this._alpha <= 0)
{
this.delta = 10;
this._alpha = 0;
} // end else if
};
} // end if
if (l != undefined)
{
if (_loc13 == true)
{
l.long = l.txt;
} // end if
l.onRollOver = function ()
{
this._parent.sel._y = this._y;
this.anim_lnk.play();
this.anim_lnk._visible = true;
this.anim_lnk.onEnterFrame = function ()
{
this._alpha = this._alpha + 20;
if (this._alpha >= 100)
{
this._alpha = 100;
delete this.onEnterFrame;
} // end if
};
if (this.long != undefined)
{
this.long.run_text();
} // end if
};
l.onRollOut = function ()
{
this.anim_lnk.onEnterFrame = function ()
{
this._alpha = this._alpha - 20;
if (this._alpha <= 0)
{
this._alpha = 0;
this._visible = false;
this.gotoAndStop(1);
delete this.onEnterFrame;
} // end if
};
if (this.long != undefined)
{
this.long.hold_text();
} // end if
};
l.onReleaseOutside = l.onRollOut;
} // end if
} // end if
l.onRelease = function ()
{
trace (this.confirm);
if (this.confirm != "1")
{
getURL(this.href, "");
}
else
{
locker._width = side_R._x;
locker._visible = true;
var _loc2 = attachMovie("confirm", "confirm_mc", getNextHighestDepth(), {_x: int(Stage.width / 2 - _x), _y: 84, href: this.href});
_loc2.bt1.onRelease = function ()
{
getURL(this._parent.href, "");
};
_loc2.bt2.onRelease = function ()
{
confirm_mc.removeMovieClip();
locker._visible = false;
};
_loc2.dr.onPress = function ()
{
this._parent.startDrag(false, 142, 0, side_R._x - 142, 193);
};
_loc2.dr.onRelease = function ()
{
this._parent.stopDrag();
};
_loc2.dr.onReleaseOutside = _loc2.dr.onRelease;
} // end else if
};
if (l != undefined)
{
yy = yy + hh;
} // end if
} // end of for
big_bg.item.D1.cacheAsBitmap = true;
for (var _loc16 in _root.myTownAdds)
{
var _loc9 = _root.myTownAdds[_loc16];
if (_loc9.type == "text")
{
createTxtDialog(_loc9.id, _loc9.x, _loc9.y, _loc9.txt);
} // end if
} // end of for...in
side_R.sub.cacheAsBitmap = true;
cur_hh = side_R.sub._height;
if (cur_hh < max_hh)
{
side_R.scr_mc.sub.item._visible = false;
}
else
{
side_R.scr_mc.sub.item.bot._y = Math.round(scr_hh * (max_hh / cur_hh));
side_R.scr_mc.sub.item.rep._height = side_R.scr_mc.sub.item.bot._y - 4;
wrk_hh = max_hh - side_R.scr_mc.sub.item.rep._height;
side_R.scr_mc.sub.item.onPress = function ()
{
this.startDrag(false, 0, 0, 0, wrk_hh);
side_R.onMouseMove = function ()
{
var _loc1;
if (side_R.scr_mc.sub.item._y == 0)
{
_loc1 = 0;
}
else
{
_loc1 = side_R.scr_mc.sub.item._y / wrk_hh;
} // end else if
side_R.sub._y = Math.round(sub_y - (cur_hh - max_hh) * _loc1);
};
};
side_R.scr_mc.sub.item.onRelease = function ()
{
this.stopDrag();
delete side_R.onMouseMove;
};
side_R.scr_mc.sub.item.onReleaseOutside = side_R.scr_mc.sub.item.onRelease;
side_R.scr_mc.scr_up.onPress = function ()
{
if (side_R.sub._y < sub_y)
{
side_R.sub._y = Math.min(side_R.sub._y + hh, sub_y);
re_scroll();
} // end if
};
side_R.scr_mc.scr_down.onPress = function ()
{
if (side_R.sub._y - sub_y > -(cur_hh - max_hh))
{
side_R.sub._y = side_R.sub._y - hh;
if (side_R.sub._y - sub_y <= -(cur_hh - max_hh))
{
side_R.sub._y = -(cur_hh - max_hh) + sub_y;
} // end if
re_scroll();
} // end if
};
} // end else if
};
var createTxtDialog = function (id, x, y, txt)
{
var _loc1 = big_bg.item.D1.attachMovie("dialog_1", "dialog_" + id, big_bg.item.D1.getNextHighestDepth(), {_x: x, _y: y});
_loc1.gotoAndStop("text");
_loc1.txt.autoSize = true;
_loc1.txt.htmlText = txt;
var _loc2 = _loc1.txt._height;
_loc2 = Math.max(_loc2, 30);
_loc1.d_bottom._y = _loc2 + 7;
_loc1.d_middle._height = _loc2 + -9;
};