[DBarbarian Entry 5] - Particle Clock

Mouse.hide();
Stage.scaleMode = "noScale";

this.pA = function(n,prop,val) {
    this.methodsA = {lineStyle:["w","c","a"],moveTo:["x","y"], curveTo:["cx","cy","ax","ay"], cx:["x"], cy:["y"], del:["d"], rad:["r"], ang:["a"]};
    (prop=="lineStyle" or prop == "moveTo" or prop=="curveTo") ? n[prop](val[this.methodsA[prop][0]],val[this.methodsA[prop][1]],val[this.methodsA[prop][2]],val[this.methodsA[prop][3]]) : n[prop]=(val[this.methodsA[prop][0]]);
    return n;
}

this.oA = new Array();

this.create = function(r,i,off,off2,r2,col) {
    this.createEmptyMovieClip("o"+i,i);
    this.pA(this["o"+i],"lineStyle",{w:r,c:col,a:100})._parent.pA(this["o"+i],"moveTo",{x:0,y:-r/2})._parent.pA(this["o"+i],"curveTo",{cx:-r/2,cy:-r/2,ax:-r/2,ay:0})._parent.pA(this["o"+i],"curveTo",{cx:-r/2,cy:r/2,ax:0,ay:r/2})._parent.pA(this["o"+i],"curveTo",{cx:r/2,cy:r/2,ax:r/2,ay:0})._parent.pA(this["o"+i],"curveTo",{cx:r/2,cy:-r/2,ax:0,ay:-r/2})._parent.pA(this["o"+i],"cx",{x:this._xmouse})._parent.pA(this["o"+i],"cy",{y:this._ymouse})._parent.pA(this["o"+i],"del",{d:3*(i-off)})._parent.pA(this["o"+i],"ang",{a:-Math.PI/2-(i-1)*Math.PI/6})._parent.pA(this["o"+i],"rad",{r:(i-off2)*r2});
    this.oA.push(this["o"+i]);
}
for (i=1;i<36;i++) {
    (i<13) ? this.create(((((i+2)%3)==0) ? 3 : 1.5),i,0,i-1,70,((((i+2)%3)==0) ? "0x33FF33" : "0xFFFFFF")):null; //ring
    (i>12 and i<17) ? this.create(3,i,12,13,10,"0xFFFFFF"):null; //hours
    (i>16 and i<25) ? this.create(2,i,16,16,7,"0xFFFFFF"):null; //minutes
    (i>24 and i<36) ? this.create(1,i,24,25,6,"0xFF0033"):null; //seconds
}

this.onEnterFrame = function() {
    for (i=1;i<36;i++) {
        for (j=0;j<2;j++) {
            (j==0) ? (this["o"+i].cx += ((this._xmouse-this["o"+i].cx)/this["o"+i].del)) : this["o"+i].cy += ((this._ymouse-this["o"+i].cy)/this["o"+i].del);
            (j==0) ? (this["o"+i]._x = this["o"+i].cx + this["o"+i].rad*Math.cos(this["o"+i].ang)):(this["o"+i]._y = this["o"+i].cy +this["o"+i].rad*Math.sin(this["o"+i].ang));
            (j==0) ? (this.rad += (Math.sqrt((this._xmouse-this.px)*(this._xmouse-this.px)+(this._ymouse-this.py)*(this._ymouse-this.py))-this.rad)/30) : this.myDate = new Date();
            this["o"+i]._xscale = this["o"+i]._yscale = 60+random(60+5*(this["o"+i]._x-this["o"+i].px+this["o"+i]._y-this["o"+i].py));
            (j==0) ? (this["o"+i].px = this["o"+i]._x) : (this["o"+i].py = this["o"+i]._y);
            (j==0) ? (this.px = this._xmouse) : (this.py = this._ymouse);
        }
        (i>12 and i<17) ? (this["o"+i].ang = ((this.myDate.getHours()-12)*Math.PI/6-Math.PI/2)+this.myDate.getMinutes()*Math.PI/360) : null; //hours
        (i>16 and i<25) ? (this["o"+i].ang = (this.myDate.getMinutes()*Math.PI/30-Math.PI/2)) : null; //minutes
        (i>24 and i<36) ? (this["o"+i].ang = (this.myDate.getSeconds()*Math.PI/30-Math.PI/2)) : null; //seconds
    }
}