labels.as

ActionScript 2 source for the CubeLogix 3D website, 73 lines: the labels, and the lines that join them to the cubes. Raw file

//  19: sprite 129 frame 1

function onEnterFrame() {
  var r6 = Stage.width;
  var r5 = Stage.height;
  var r2;
  var r4;
  r2 = r6 * 0.5 - l1d;
  r4 = -r5 * 0.5 + 8;
  if (r2 > 0) {
    r2 = 0;
  }
  if (r2 < -70) {
    r2 = -70;
  }
  if (r4 < -280) {
    r4 = -280;
  }
  label1._x = r2;
  label1._y = r4;
  label2._x = r2 + l2x - l1x;
  label2._y = r4 + 36;
  label3._x = r2 + l3x - l1x;
  label3._y = r4 + 72;
  var r3 = _parent._parent.smash.cube_scene;
  b.clear();
  dot1._x = r3.cube2.sp[0];
  dot1._y = -r3.cube2.sp[1];
  dot4._x = label1._x - 11;
  dot4._y = label1._y + 11;
  b.lineStyle(4, 5556725, 100);
  b.moveTo(dot1._x, dot1._y);
  if (dot4._y + (dot4._x - dot1._x) < dot1._y) {
    b.lineTo(dot1._x, dot4._y + (dot4._x - dot1._x));
  } else {
    b.lineTo(dot4._x + (dot4._y - dot1._y), dot1._y);
  }
  b.lineTo(dot4._x - 3, dot4._y + 3);
  dot2._x = r3.cube3.sp[0];
  dot2._y = -r3.cube3.sp[1];
  dot5._x = label2._x - 11;
  dot5._y = label2._y + 11;
  b.lineStyle(4, 11767002, 100);
  b.moveTo(dot2._x, dot2._y);
  if (dot5._y + (dot5._x - dot2._x) < dot2._y) {
    b.lineTo(dot2._x, dot5._y + (dot5._x - dot2._x));
  } else {
    b.lineTo(dot5._x + (dot5._y - dot2._y), dot2._y);
  }
  b.lineTo(dot5._x - 3, dot5._y + 3);
  dot3._x = r3.cube1.sp[0];
  dot3._y = -r3.cube1.sp[1];
  dot6._x = label3._x - 11;
  dot6._y = label3._y + 11;
  b.lineStyle(4, 16621565, 100);
  b.moveTo(dot3._x, dot3._y);
  if (dot6._y + (dot6._x - dot3._x) < dot3._y) {
    b.lineTo(dot3._x, dot6._y + (dot6._x - dot3._x));
  } else {
    b.lineTo(dot6._x + (dot6._y - dot3._y), dot3._y);
  }
  b.lineTo(dot6._x - 3, dot6._y + 3);
}
dot1.gotoAndStop(1);
dot2.gotoAndStop(2);
dot3.gotoAndStop(3);
dot4.gotoAndStop(4);
dot5.gotoAndStop(5);
dot6.gotoAndStop(6);
l1x = label1._x;
l2x = label2._x;
l3x = label3._x;
l1d = 400 - l1x;