class assets.egStraight extends MovieClip { var num; function egStraight() { highlight(false); stop(); } function redraw() { drawText(); drawLine(); } var outerColor, tickness; function drawText() { num.text._width = 20; num.text._height = 19; var txtf = new TextFormat(); txtf.color = outerColor; num.text.setNewTextFormat(txtf); num.text.border = true; num.text.borderColor = outerColor; num.text.background = true; num.text.backgroundColor = 0xFFFFFF; if (_parent.link.attributes.cost != undefined) num.text.text = _parent.link.attributes.cost; num._x = (_parent.nodeyx - _parent.nodexx) / 2; num._y = (_parent.nodeyy - _parent.nodexy) / 2; num._rotation = Math.atan((_parent.nodeyy-_parent.nodexy)/(_parent.nodeyx-_parent.nodexx))/Math.PI*180; } function drawLine() { clear(); lineStyle(tickness, outerColor); moveTo(0, 0); curveTo(_parent.linkx-_parent.nodexx, _parent.linky-_parent.nodexy, _parent.nodeyx-_parent.nodexx, _parent.nodeyy-_parent.nodexy); } function highlight(wValue) { if (wValue == false) { tickness = 2; outerColor = 0x999999; } else { tickness = 3; if (wValue === true) wValue = 0x006699; outerColor = wValue; } redraw(); } }