// Action script...
// [onClipEvent of sprite 44 in frame 1]
onClipEvent (enterFrame)
{
f = this._currentFrame;
}
// [onClipEvent of sprite 51 in frame 1]
onClipEvent (load)
{
amount = 1;
}
// [Action in Frame 1]
function showSkin(stat)
{
leftLeg.shin.thigh.skin._visible = stat;
rightLeg.shin.thigh.skin._visible = stat;
leftLeg.shin.foot.skin._visible = stat;
rightLeg.shin.foot.skin._visible = stat;
spine.ribs.neck.torso.skin._visible = stat;
spine.skin._visible = stat;
rightFoot.skin._visible = stat;
leftFoot.skin._visible = stat;
} // End of the function
function showBones(stat)
{
leftLeg.shin.thigh.bone._visible = stat;
rightLeg.shin.thigh.bone._visible = stat;
leftLeg.shin.foot.bone._visible = stat;
rightLeg.shin.foot.bone._visible = stat;
leftFoot.bone._visible = stat;
rightFoot.bone._visible = stat;
spine._visible = stat;
leftArm._visible = stat;
rightArm._visible = stat;
} // End of the function
function showConstrains(stat)
{
spine.MINcon._visible = stat;
spine.MAXcon._visible = stat;
spine.CON._visible = stat;
leftLeg.line._visible = stat;
rightLeg.line._visible = stat;
leftArm.line._visible = stat;
rightArm.line._visible = stat;
} // End of the function
function tempCoords()
{
c = 0;
if (c < 13)
{
tempX[c] = x[c];
tempy[c] = y[c];
c++;
} // End of the function
} // end if
function pull(Pa, Ch, constrainD)
{
var distance;
var ang;
var rad;
disX = x[Pa] - x[Ch];
disY = y[Pa] - y[Ch];
distance = Math.sqrt(disX * disX + disY * disY);
ang = Math.atan2(disY, disX) / RADIANS;
rad = ang * RADIANS;
x[Ch] = x[Ch] - (constrainD - distance) * Math.cos(rad);
y[Ch] = y[Ch] - (constrainD - distance) * Math.sin(rad);
} // End of the function
function lockAngle(Pa, Ch, constrainD, ConstrainAng)
{
x[Ch] = x[Pa] + constrainD * Math.cos(constrainAng * RADIANS);
y[Ch] = y[Pa] + constrainD * Math.sin(constrainAng * RADIANS);
} // End of the function
function handle(pointDragged, num, constrainD)
{
var disX;
var disY;
disX = this[pointDragged]._x - drag._x;
disY = this[pointDragged]._y + 400 - drag._y;
OverSwingX[num] = OverSwingX[num] + disX / 20;
OverSwingY[num] = OverSwingY[num] + disY / 10;
drag._x = drag._x + (disX / 10 + OverSwingX[num]);
drag._y = drag._y + (disY / 5 + OverSwingY[num]);
} // End of the function
function update(group, A, B, dragable, Pa, Ch)
{
var difX;
var dis;
var Pa;
var Ch;
var dragable;
var oldAngle;
var newAngle;
var Angle;
var theta;
var rot;
oldAngle = "old" + group + "Angle";
newAngle = "new" + group + "Angle";
Angle = group + "Angle";
theta = group + "Theta";
rot = group + "Rot";
if (A == 1)
{
knee = 10;
f = "leftFoot";
foot = 12;
oppLeg = "rightLeg";
}
else
{
knee = 11;
f = "rightFoot";
foot = 13;
oppLeg = "leftLeg";
} // end if
difX = x[A] - x[B];
difY = y[A] - y[B];
dis = Math.sqrt(difX * difX + difY * difY);
if (dis > 215)
{
dis = 215;
if (dragable == true)
{
pull(Pa, Ch, 215);
} // end if
}
else if (dis < 50)
{
dis = 50;
if (dragable == true)
{
pull(Pa, Ch, 50);
} // end if
} // end if
this[oldAngle] = this[newAngle];
this[newAngle] = Math.round(Math.atan2(difX, difY) / RADIANS) + 180;
if (this[oldAngle] < this[newAngle] - 180)
{
this[rot] = this[rot]--;
}
else if (this[newAngle] + 180 < this[oldAngle])
{
this[rot] = this[rot]++;
} // end if
this[angle] = this[newAngle] + 360 * this[rot];
this[theta] = 90 - Math.round(Math.acos(dis / 2 / 110) / RADIANS);
this[group + "ThighAngle"] = this[angle] - this[theta] + 90;
this[group + "Dis"] = dis;
if (hipAngle + 120 < this[group + "ThighAngle"])
{
limit = hipAngle + 120;
this[angle] = -(90 - limit - this[theta]);
this[group + "ThighAngle"] = this[angle] - this[theta] + 90;
x[B] = dis * Math.sin(this[angle] * RADIANS) + x[A];
y[B] = dis * Math.cos(this[angle] * RADIANS) + y[A];
}
else if (this[group + "ThighAngle"] < hipAngle - 60)
{
limit = hipAngle - 60;
this[angle] = -(90 - limit - this[theta]);
this[group + "ThighAngle"] = this[angle] - this[theta] + 90;
x[B] = dis * Math.sin(this[angle] * RADIANS) + x[A];
y[B] = dis * Math.cos(this[angle] * RADIANS) + y[A];
} // end if
this[group].gotoAndStop(Math.round(this[theta] * 2 + 1));
this[group].shin.gotoAndStop(Math.round(this[theta] * 2 + 1));
this[group]._x = x[A];
this[group]._y = y[A];
this[group]._rotation = -this[angle];
leftFootAngle = Math.round(Math.atan2(x[2] - x[12], y[2] - y[12]) / RADIANS) + 180;
x[knee] = 110 * Math.cos((this[angle] - this[theta]) * RADIANS) + x[A];
y[knee] = 110 * -Math.sin((this[angle] - this[theta]) * RADIANS) + y[A];
if (floor < y[B])
{
y[B] = floor;
} // end if
x[foot] = 70 * Math.sin((this[angle] + this[theta]) * RADIANS) + x[B];
y[foot] = 70 * Math.cos((this[angle] + this[theta]) * RADIANS) + y[B];
if (floor < y[foot])
{
y[foot] = floor;
} // End of the function
} // end if
function refreshSpine(group, A, B, dragable, Pa, Ch)
{
var difY;
var difX;
var dis;
var Pa;
var Ch;
var dragable;
difX = x[A] - x[B];
difY = y[A] - y[B];
dis = Math.sqrt(difX * difX + difY * difY);
if (dis != 120)
{
dis = 120;
if (dragable == true)
{
pull(Pa, Ch, 120);
} // end if
} // end if
if (leftLegThighAngle < rightLegThighAngle)
{
hipOffset = -Math.round(rightLegThighAngle + (leftLegThighAngle - rightLegThighAngle) / 2);
MAX = rightLegThighAngle - 120 + hipOffset;
MIN = leftLegThighAngle + 60 + hipOffset;
}
else
{
hipOffset = -Math.round(leftLegThighAngle + (rightLegThighAngle - leftLegThighAngle) / 2);
MAX = leftLegThighAngle - 120 + hipOffset;
MIN = rightLegThighAngle + 60 + hipOffset;
} // end if
oldSpineAngle = newSpineAngle;
localHipOffset = hipOffset - Math.floor(hipOffset / 360) * 360;
newSpineAngle = Math.round(Math.atan2(difX, difY) / RADIANS) + localHipOffset + 180;
if (oldSpineAngle < newSpineAngle - 180 && spineRot > -1)
{
spineRot--;
}
else if (newSpineAngle + 180 < oldSpineAngle && spineRot < 1)
{
spineRot++;
} // end if
spineAngle = newSpineAngle + 360 * spineRot;
if (spineAngle < MAX + 180)
{
lockAngle(0, 5, 120, hipOffset - 90 - MAX);
if (MAX < 60)
{
hipAngle = MAX + 60 - hipOffset;
spineAngle = 120 + (MAX + 60);
}
else
{
spineAngle = 120;
} // end if
}
else if (MIN + 180 < spineAngle)
{
lockAngle(0, 5, 120, hipOffset - 90 - MIN);
if (MIN > 60)
{
hipAngle = MIN - 60 - hipOffset;
spineAngle = 240 - (60 - MIN);
}
else
{
spineAngle = 240 - (60 - MIN);
} // end if
} // end if
if (spineAngle > 240)
{
hipAngle = spineAngle - hipOffset - 240;
}
else if (spineAngle < 120)
{
hipAngle = spineAngle - hipOffset - 120;
}
else
{
hipAngle = -hipOffset;
} // end if
this[group]._rotation = -hipAngle;
this[group].MAXcon._rotation = -MAX - -hipAngle + hipOffset;
this[group].MINcon._rotation = -MIN - -hipAngle + hipOffset;
this[group].gotoAndStop(spineAngle);
this[group].ribs.gotoAndStop(spineAngle);
this[group].ribs.neck.gotoAndStop(spineAngle);
this[group]._x = x[A];
this[group]._y = y[A];
} // End of the function
...
...
...
......
.........
............