Symbol 21 MovieClip [SS_clock] Frame 1
#initclip 1
SS_clock = function () {
this.init();
};
SS_clock.prototype = MovieClip.prototype;
Object.registerClass("SS_clock", SS_clock);
SS_clock.prototype.init = function () {
this.bounding_box._visible = 0;
this.w = this._width;
this.createEmptyMovieClip("clock", 1);
if (this.$large) {
this.clock.createEmptyMovieClip("line0", 1);
this.rectangle(this.clock.line0, 49, -2, 4, 8, this.$strokeColor);
var a = 1;
while (a < 12) {
this.clock.line0.duplicateMovieClip("line" + a, a + 1, {_rotation:a * 30});
a++;
}
}
if (this.$small) {
this.clock.createEmptyMovieClip("line_b0", 100);
this.rectangle(this.clock.line_b0, 52, 0, 1, 5, this.$strokeColor);
var a = 0;
while (a < 60) {
this.clock.line_b0.duplicateMovieClip("line_b" + a, a + 101, {_rotation:a * 6});
a++;
}
}
if (this.$rounded) {
this.clock.drawCircle(0, 0, this._width / 2, 2, this.$strokeColor, this.$fillColor, 100);
}
this.clock.createEmptyMovieClip("secondi", 1000);
this.rectangle(this.clock.secondi, -5, 0, 1, 50, this.$strokeColor);
this.clock.createEmptyMovieClip("minuti", 1001);
this.rectangle(this.clock.minuti, -5, -1.5, 3, 50, this.$strokeColor);
this.clock.createEmptyMovieClip("ore", 1003);
this.rectangle(this.clock.ore, -5, -2.5, 5, 35, this.$strokeColor);
this._width = (this._height = this.w);
if (this.$_enableShadow) {
this.drawShadow(this);
}
this.startClock(this);
this.$mainTime = setInterval(this.startClock, ((this.$cont == true) ? 10 : 1000), this);
this.$_theInt = ((this.$cont == true) ? 10 : 1000);
};
SS_clock.prototype.changeInterval = function (newInterval) {
clearInterval(this.$mainTime);
this.$mainTime = setInterval(this.startClock, newInterval, this);
this.$_theInt = newInterval;
};
SS_clock.prototype.getInterval = function () {
return(this.$_theInt);
};
SS_clock.prototype.drawShadow = function (obj) {
obj.clock.createEmptyMovieClip("minuti_2", 800);
obj.rectangle(this.clock.minuti_2, -5, -1.5, 3, 50, obj.$_shadowColor);
obj.clock.createEmptyMovieClip("ore_2", 700);
obj.rectangle(this.clock.ore_2, -5, -2.5, 5, 35, obj.$_shadowColor);
obj.clock.createEmptyMovieClip("secondi_2", 900);
obj.rectangle(this.clock.secondi_2, -5, 0, 1, 50, obj.$_shadowColor);
obj.clock.secondi_2._alpha = (obj.clock.minuti_2._alpha = (obj.clock.ore_2._alpha = obj.$_shadowAlpha));
};
SS_clock.prototype.killShadow = function () {
this.$_enableShadow = false;
unloadMovie (this.clock.secondi_2);
unloadMovie (this.clock.minuti_2);
unloadMovie (this.clock.ore_2);
};
SS_clock.prototype.start = function () {
this.$mainTime = setInterval(this.startClock, ((this.$cont == true) ? 10 : 1000), this);
};
SS_clock.prototype.startClock = function (obj) {
var d = new Date();
var s = d.getSeconds();
var mm = d.getMilliseconds();
var m = d.getMinutes();
var h = d.getHours();
h = ((h >= 12) ? (h - 12) : (h));
var s1 = ((s + (mm / 1000)) * 6);
var m1 = ((m + (s1 / 360)) * 6);
var h1 = ((h + (m1 / 360)) * 30);
obj.clock.secondi._rotation = s1 - 90;
obj.clock.minuti._rotation = m1 - 90;
obj.clock.ore._rotation = h1 - 90;
if (obj.$_enableShadow) {
obj.clock.secondi_2._rotation = obj.clock.secondi._rotation;
obj.clock.minuti_2._rotation = obj.clock.minuti._rotation;
obj.clock.ore_2._rotation = obj.clock.ore._rotation;
obj.clock.secondi_2._x = obj.clock.secondi._x + 2;
obj.clock.secondi_2._y = obj.clock.secondi._y + 2;
obj.clock.minuti_2._x = obj.clock.minuti._x + 1.5;
obj.clock.minuti_2._y = obj.clock.minuti._y + 1.5;
obj.clock.ore_2._x = obj.clock.ore._x + 1.5;
obj.clock.ore_2._y = obj.clock.ore._y + 1.5;
}
};
SS_clock.prototype.stop = function () {
clearInterval(this.$mainTime);
};
SS_clock.prototype.drawCircle = function (thex, they, theradius, lineW, lineColor, fillColor, fillAlpha) {
var x;
var y;
var r;
var u;
var v;
x = thex;
y = they;
r = theradius;
u = r * 0.408600002527237;
v = r * 0.707099974155426;
if (lineW != "") {
this.lineStyle(lineW, lineColor, 100);
}
if ((fillColor != undefined) || (fillColor != "")) {
this.beginFill(fillColor, fillAlpha);
}
this.moveTo(x - r, y);
this.curveTo(x - r, y - u, x - v, y - v);
this.curveTo(x - u, y - r, x, y - r);
this.curveTo(x + u, y - r, x + v, y - v);
this.curveTo(x + r, y - u, x + r, y);
this.curveTo(x + r, y + u, x + v, y + v);
this.curveTo(x + u, y + r, x, y + r);
this.curveTo(x - u, y + r, x - v, y + v);
this.curveTo(x - r, y + u, x - r, y);
if ((fillColor != undefined) || (fillColor != "")) {
this.endFill();
}
};
SS_clock.prototype.rectangle = function (obj, x, y, h, w, rgb) {
obj.lineStyle(0, 0, 0);
obj.beginFill(rgb, 100);
obj.moveTo(x, y);
obj.lineTo(x + w, y);
obj.lineTo(x + w, y + h);
obj.lineTo(x, y + h);
obj.lineTo(x, y);
obj.endFill();
};
#endinitclip
Symbol 29 MovieClip Frame 2129
stop();
Symbol 34 MovieClip Frame 4270
stop();
Symbol 36 MovieClip Frame 1
Instance of Symbol 21 MovieClip [SS_clock] "theClock" in Symbol 36 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
$fillColor = 13421798 /* 0xCCCCE6 */;
$strokeColor = 3355443 /* 0x333333 */;
$large = true;
$small = true;
$cont = true;
$rounded = false;
$_enableShadow = true;
$_shadowColor = 10066329 /* 0x999999 */;
$_shadowAlpha = 30;
}