Skip to content

Instantly share code, notes, and snippets.

@Zemnmez
Created July 10, 2014 04:42
Show Gist options
  • Save Zemnmez/bd1587bdfc7d151aacbe to your computer and use it in GitHub Desktop.
Save Zemnmez/bd1587bdfc7d151aacbe to your computer and use it in GitHub Desktop.
movie 'C:\Users\IEUser\Documents\graph.swf' {
// flash 8, total frames: 1, frame rate: 12 fps, 680x180 px, compressed
movieClip 2 {
}
movieClip 8 {
frame 1 {
stop();
}
}
button 10 {
on (rollOver) {
this.callOutOvr();
}
on (releaseOutside, rollOut) {
this.callOutOut();
}
on (press) {
this.callOutHit();
}
}
button 12 {
on (rollOver) {
_parent.callOutOvr();
}
on (rollOut) {
_parent.callOutOut();
}
}
movieClip 14 {
}
movieClip 16 {
}
movieClip 21 {
}
button 24 {
on (rollOver) {
_parent.callOutOvr();
}
on (rollOut) {
_parent.callOutOut();
}
on (release) {
_parent.editAnnotation();
}
}
movieClip 26 {
frame 1 {
btn.useHandCursor = false;
stop();
}
}
movieClip 27 ctn_detail {
frame 1 {
btn_hit.useHandCursor = false;
}
}
movieClip 29 {
}
movieClip 32 {
frame 1 {
stop();
}
}
movieClip 34 ctn_callOut {
}
movieClip 38 ctn_dateLine {
}
movieClip 42 ctn_Xline {
}
button 45 {
on (rollOver) {
_root.attachMovie('ctn_callOut', 'callOut', 10000);
var coGrid = new flash.geom.Rectangle(1, 1, 8, 8);
_root.callOut.mc_callOut_bg.scale9Grid = coGrid;
_root.callOut._y = 100;
_root.callOut._x = 100;
_root.callOut.tf_callOut.autoSize = true;
_root.callOut.tf_callOut.text = this.dataValue + ' ' + _global.Ylab;
_root.callOut.mc_callOut_bg._width = _root.callOut.tf_callOut._width;
_root.callOut.mc_callOut_handle._alpha = 0;
sliceColor = new Color(_parent);
_global.myoldColor = sliceColor.getRGB();
sliceColor.setRGB(16777215);
var slc = _parent.sliceNum;
keyColor = new Color(_root.pie_mc['mc_pie_key' + slc]);
_global.myoldKeyColor = keyColor.getRGB();
keyColor.setRGB(16777215);
}
on (releaseOutside, rollOut) {
this.pieOut();
var slc = _parent.sliceNum;
(new Color(_parent)).setTransform({'ra': 100, 'rb': null, 'ba': 100, 'bb': null, 'ga': 100, 'gb': null, 'aa': 100, 'ab': null});
(new Color(_root.pie_mc['mc_pie_key' + slc])).setTransform({'ra': 100, 'rb': null, 'ba': 100, 'bb': null, 'ga': 100, 'gb': null, 'aa': 100, 'ab': null});
_root.callOut.removeMovieClip();
}
}
movieClip 49 {
frame 1 {
stop();
}
}
movieClip 57 mc_pie_slice {
frame 1 {
btn_pie_slice.useHandCursor = false;
stop();
}
}
movieClip 58 {
frame 1 {
stop();
}
}
button 61 {
on (rollOver) {
var slc = this.sliceNum;
var pieArea = _root.pie_mc['pie_mc_area' + slc];
sliceColor = new Color(pieArea);
_global.myoldColor = sliceColor.getRGB();
sliceColor.setRGB(16777215);
_root.attachMovie('ctn_callOut', 'callOut', 10000);
var coGrid = new flash.geom.Rectangle(1, 1, 8, 8);
_root.callOut.mc_callOut_bg.scale9Grid = coGrid;
_root.callOut._y = 100;
_root.callOut._x = 100;
_root.callOut.tf_callOut.autoSize = true;
_root.callOut.mc_callOut_handle._alpha = 0;
keyColor = new Color(this);
_global.myoldKeyColor = keyColor.getRGB();
keyColor.setRGB(16777215);
_root.callOut.tf_callOut.text = _root.pie_mc['pie_mc_area' + slc].mc_pie_slice0.dataValue + ' ' + _global.Ylab;
_root.callOut.mc_callOut_bg._width = _root.callOut.tf_callOut._width;
}
on (releaseOutside, rollOut) {
var slc = this.sliceNum;
(new Color(this)).setTransform({'ra': 100, 'rb': null, 'ba': 100, 'bb': null, 'ga': 100, 'gb': null, 'aa': 100, 'ab': null});
(new Color(_root.pie_mc['pie_mc_area' + slc])).setTransform({'ra': 100, 'rb': null, 'ba': 100, 'bb': null, 'ga': 100, 'gb': null, 'aa': 100, 'ab': null});
_root.callOut.removeMovieClip();
}
}
movieClip 69 mc_pie_key {
frame 1 {
btn_hit.useHandCursor = false;
stop();
}
}
movieClip 70 mc_pie_div {
}
movieClip 73 {
}
movieClip 75 mc_line_legend {
frame 1 {
stop();
}
}
button 77 {
on (press) {
_parent.cnclAnnotation();
}
}
button 81 {
on (press) {
_parent.addAnnotation();
}
}
button 84 {
on (release) {
_parent.cnclAnnotation();
}
}
movieClip 87 ctn_addAnnotation {
}
movieClip 89 ctn_horiz_div {
}
frame 1 {
function loadCheck() {
if (data_xml.loaded != true) {
_root.ctn_loading.gotoAndStop(3);
delete loaderInterval;
}
}
function FormatNumber(toFormat, formatType) {
if (formatType == 'currency') {
return FormatAsDollars(toFormat, undefined, true);
} else {
if (formatType == 'thousand') {
return Number(toFormat) / 1000 + 'k';
} else {
if (formatType == 'million') {
var v1 = toFormat / 1000000;
if (v1 >= 1) {
var v5 = int(v1 * 100) / 100;
return v5 + 'M';
} else {
if (v1 == 0) {
return 0;
} else {
var v5 = int(v1 * 100) / 100;
var v4 = v5 * 1000;
return v4 + ',000';
}
}
} else {
if (formatType == 'percent') {
var v6 = Math.round(100 * Number(toFormat));
return Number(v6) / 100 + ' %';
}
}
}
}
}
function FormatAsDollars(amount, isCents, hideCents) {
if (isNan(amount)) {
return NaN;
}
if (isCents != 'isCents') {
amount *= 100;
amount = Math.round(amount);
}
amount = String(Math.floor(amount));
if (amount.length == 1) {
return '$0.0' + amount;
}
if (amount.length == 2) {
return '$0.' + amount;
}
cents = amount.slice(-2);
amount = amount.substring(0, amount.length - 2);
dollars = [];
do {
dollars.push(amount.slice(-3));
amount = amount.substring(0, amount.length - 3);
} while (amount.length > 3);
if (amount.length) {
dollars.push(amount);
}
dollars.reverse();
if (hideCents) {
return '$' + dollars.join();
} else {
return '$' + dollars.join() + '.' + cents;
}
}
_global.dataURL = _root.dataURL;
_global.start_Lines = function () {
var v25 = _global.maxYrange;
var v13 = _global.minYrange;
var v24 = _global.maxYrange_right;
var v12 = _global.minYrange_right;
var v34 = 1;
var v35 = true;
var v10 = _global.graphHeight;
var v29 = _global.dataSet[0].childNodes;
if (_global.showYlab != 'false') {
if (_global.YlabCount == undefined) {
var v23 = int(v10 / 30);
var v46 = (Number(v10) - 3) / Number(v23);
} else {
var v23 = _global.YlabCount;
var v46 = (Number(v10) - 3) / Number(v23);
}
var v7 = 0;
while (v7 <= v23) {
var v43 = ((Number(v25) - Number(v13)) / v23) * (v23 - v7) + Number(v13);
var v18 = new TextFormat();
v18.bold = true;
v18.font = 'Arial';
v18.size = 10;
v18.align = 'right';
if (_global.YlabColor != undefined) {
v18.color = _global.YlabColor;
} else {
v18.color = 8355711;
}
_root.createTextField('tf_ylab_' + v7, 300 + v7, 2, 5 + int(v46 * v7), 49, 15);
_root['tf_ylab_' + v7].setNewTextFormat(v18);
if (_global.YlabFormat != undefined) {
_root['tf_ylab_' + v7].text = FormatNumber(v43, _global.YlabFormat);
} else {
var v51 = (Number(v43) / 100) * 100;
var v47 = Math.round(100 * Number(v51));
_root['tf_ylab_' + v7].text = Number(v47) / 100;
}
if (_global.showYlab_right == 'true') {
var v41 = ((Number(v24) - Number(v12)) / v23) * (v23 - v7) + Number(v12);
var v20 = new TextFormat();
v20.bold = true;
v20.font = 'Arial';
v20.size = 10;
v20.align = 'left';
v20.color = _global.YlabColor_right;
_root.ctn_tf_right.createTextField('tf_ylab_right_' + v7, 100 + v7, 0, int(v46 * v7), 49, 15);
_root.ctn_tf_right['tf_ylab_right_' + v7].setNewTextFormat(v20);
if (_global.YlabFormat_right != undefined) {
_root.ctn_tf_right['tf_ylab_right_' + v7].text = FormatNumber(v41, _global.YlabFormat_right);
} else {
v51 = (Number(v41) / 100) * 100;
v47 = Math.round(100 * Number(v51));
_root.ctn_tf_right['tf_ylab_right_' + v7].text = Number(v47) / 100;
}
}
if (v7 > 0 && v7 <= v23) {
_root.ctn_graph.attachMovie('ctn_horiz_div', 'ctn_horiz_div' + v7, 100 + v7);
_root.ctn_graph['ctn_horiz_div' + v7]._y = 8 + int(v46 * v7);
}
++v7;
}
}
var v8 = 0;
while (v8 < v29.length) {
var v45 = v29[v8].firstChild.nodeValue;
if (v8 == 1 && _global.maxYrange_right != undefined) {
var v50 = -((v45 - Number(v12)) / (Number(v24) - Number(v12))) * Number(v10);
} else {
var v50 = -((v45 - Number(v13)) / (Number(v25) - Number(v13))) * Number(v10);
}
_global['pen_ypos' + v8] = v50;
_root.createEmptyMovieClip('pen_mc' + v8, 6 + v8);
_root['pen_mc' + v8]._x = 60;
_root['pen_mc' + v8]._y = Number(v10) + 10;
_root['pen_mc' + v8].lineStyle(1, _global.legendData[v8].attributes.clr, 101 + v8, false, 'none', 'none', 'round');
_root['pen_mc' + v8].moveTo(0, _global['pen_ypos' + v8]);
if (_global.legendData[v8].attributes.showProjection == 'true') {
var v39 = dataSet.length - _global.legendData[v8].attributes.projectionRange;
}
++v8;
}
if (_global.legendData.length > 0) {
var v9 = 0;
while (v9 < _global.legendData.length) {
_root.attachMovie('mc_line_legend', 'mc_line_legend' + v9, 650 + v9);
if (v9 == 0) {
_root['mc_line_legend' + v9]._x = 56;
} else {
_root['mc_line_legend' + v9]._x = _root['mc_line_legend' + (v9 - 1)]._x + _root['mc_line_legend' + (v9 - 1)]._width + 15;
}
_root['mc_line_legend' + v9]._y = 12;
var v48 = new Color(_root['mc_line_legend' + v9].clr);
v48.setRGB(_global.legendData[v9].attributes.clr);
_root['mc_line_legend' + v9].tf_title.autoSize = true;
_root['mc_line_legend' + v9].tf_title.text = _global.legendData[v9].firstChild.nodeValue;
++v9;
}
}
_root.createEmptyMovieClip('lines_mc', 4);
_root.lines_mc._x = 60;
_root.lines_mc._y = Number(v10) + 10;
_root.createEmptyMovieClip('detail_mc', 100);
_root.detail_mc._x = 60;
_root.detail_mc._y = Number(v10) + 10;
var v3 = 0;
while (v3 < dataSet.length) {
var v49 = _global.spacing;
var v11 = _global.dataSet[v3].childNodes;
var v32 = _global.dataSet[v3 - 1].childNodes;
if (_global.spacing == '0') {
var v22 = _global.graphWidth - 10;
var v19 = _global.dataSet.length - 1;
var v15 = Math.round(v3 * v22 / v19);
var v26 = Math.round((v3 - 1) * v22 / v19);
var v36 = (v15 - v26) / 2;
var v42 = v36 / 2;
var v38 = v26 + v36;
var v40 = v26 + v42;
var v44 = v26 + v36 + v42;
} else {
var v15 = Math.round(v3 * v49);
}
var v6 = 0;
while (v6 <= v29.length) {
v29 = _global.dataSet[0].childNodes;
v45 = v29[0].firstChild.nodeValue;
if (v6 == 1 && _global.maxYrange_right != undefined) {
var v16 = ((v11[v6].firstChild.nodeValue - Number(v12)) / (Number(v24) - Number(v12))) * Number(v10);
var v14 = ((v32[v6].firstChild.nodeValue - Number(v12)) / (Number(v24) - Number(v12))) * Number(v10);
var v21 = (v16 - v14) / 2 + v14;
} else {
var v16 = ((v11[v6].firstChild.nodeValue - Number(v13)) / (Number(v25) - Number(v13))) * Number(v10);
var v14 = ((v32[v6].firstChild.nodeValue - Number(v13)) / (Number(v25) - Number(v13))) * Number(v10);
var v21 = (v16 - v14) / 2 + v14;
}
if (v21 <= 0) {
_global['halfYpos_' + v6] = 0;
} else {
_global['halfYpos_' + v6] = v21;
}
if (v14 <= 0) {
_global['lastYpos_' + v6] = 0;
} else {
_global['lastYpos_' + v6] = v14;
}
if (v16 <= 0) {
_global['ypos_' + v6] = 0;
} else {
_global['ypos_' + v6] = v16;
}
++v6;
}
var v37 = _global.barWidth;
_root.lines_mc.attachMovie('ctn_Xline', 'ctn_Xline' + v3, -300 - v3);
_root.lines_mc['ctn_Xline' + v3]._x = v15;
if (_global.labFreq != undefined) {
if (_global.labFreq == 1) {
v35 = true;
} else {
if (v34 == 1) {
++v34;
v35 = true;
} else {
if (v34 == _global.labFreq) {
v34 = 1;
v35 = false;
} else {
++v34;
v35 = false;
}
}
}
if (v35) {
_root.lines_mc['ctn_Xline' + v3].tf_bottom.autoSize = true;
_root.lines_mc['ctn_Xline' + v3].tf_bottom.text = _global.dataSet[v3].attributes.dataInterval;
_root.lines_mc['ctn_Xline' + v3].tf_bottom._y = _root.lines_mc['ctn_Xline' + v3].tf_bottom._height + 10;
_root.lines_mc['ctn_Xline' + v3].tf_bottom._x += v37 / 2;
if (_global.dataSet[v3].attributes.dataSection != undefined) {
_root.lines_mc['ctn_Xline' + v3].tf_bottomSection.autoSize = true;
_root.lines_mc['ctn_Xline' + v3].tf_bottomSection.text = _global.dataSet[v3].attributes.dataSection;
_root.lines_mc['ctn_Xline' + v3].tf_bottomSection._y = _root.lines_mc['ctn_Xline' + v3].tf_bottomSection._height + 10;
_root.lines_mc['ctn_Xline' + v3].tf_bottomSection._x += v37 / 2;
} else {
_root.lines_mc['ctn_Xline' + v3].tf_bottomSection.text = '';
}
} else {
_root.lines_mc['ctn_Xline' + v3].tf_bottomSection.text = '';
_root.lines_mc['ctn_Xline' + v3].tf_bottom.text = '';
}
}
var v5 = 0;
while (v5 <= v29.length) {
v29 = _global.dataSet[0].childNodes;
v45 = v29[0].firstChild.nodeValue;
if (v3 >= v39) {
if (_global.legendData[v5].attributes.showProjection == 'true') {
_root['pen_mc' + v5].lineStyle(1, _global.legendData[v5].attributes.projectionColor, 101 + v5, false, 'none', 'none', 'round');
}
}
if (v3 == 0) {
_root['pen_mc' + v5].lineTo(v15, -_global['ypos_' + v5]);
} else {
if (_global.legendData[v5].attributes.smoothing == 'true') {
_root['pen_mc' + v5].curveTo(storedv40, -_global['lastYpos_' + v5], storedv38, -_global['halfYpos_' + v5]);
_root['pen_mc' + v5].curveTo(storedv44, -_global['ypos_' + v5], v15, -_global['ypos_' + v5]);
} else {
_root['pen_mc' + v5].lineTo(v15, -_global['ypos_' + v5]);
}
}
++v5;
}
var v4 = 0;
while (v4 < v11.length) {
var v17 = -Math.floor(_global['ypos_' + v4]) + 1;
_global.showDataPoints = _global.legendData[v4].attributes.dataPoints != 'false';
if (_global.showDataPoints) {
_root.detail_mc.attachMovie('ctn_detail', 'ctn_detailArea' + v3 * 3 + v4, 900 - v3 * 3 - v4);
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4].ctn_color.gotoAndStop(_global.barColor);
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4].ctn_color._alpha = 0;
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4]._x = v15 - 2;
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4]._y = v17;
if (_global.hitSpaceFull == 'true') {
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4].btn_hit._y = -v17;
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4].mc_vertLine._height = v10;
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4].btn_hit._height = v10;
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4].btn_hit._width = storedv22 / storedv19;
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4].btn_hit._x = -(storedv22 / storedv19 / 2);
} else {
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4].btn_hit._height = 8;
}
if (_global.showVertLine != 'true') {
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4].mc_vertLine._alpha = 0;
} else {
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4].ctn_color._alpha = 0;
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4].mc_vertLine._y = -v17;
}
if (_global.annotations == 'true') {
if (_global.dataSet[v3].attributes.annotation != undefined) {
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4].mc_annotateFlag.annotation = _global.dataSet[v3].attributes.annotation;
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4].mc_annotateFlag.annotationLink = _global.dataSet[v3].attributes.annotationLink;
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4].mc_annotateFlag.gotoAndStop(2);
}
}
if (_global.legendData[v4].attributes.ttPre == 'dataInterval') {
var v30 = _global.dataSet[v3].attributes.dataInterval + ' ';
} else {
if (_global.legendData[v4].attributes.ttPre == undefined || _global.legendData[v4].attributes.ttPre == '') {
var v30 = '';
} else {
var v30 = _global.legendData[v4].attributes.ttPre + ' ';
}
}
if (_global.legendData[v4].attributes.ttSuf == 'dataInterval') {
var v31 = ' ' + _global.dataSet[v3].attributes.dataInterval;
} else {
if (_global.legendData[v4].attributes.ttSuf == undefined || _global.legendData[v4].attributes.ttSuf == '') {
var v31 = '';
} else {
var v31 = ' ' + _global.legendData[v4].attributes.ttSuf;
}
}
if (_global.legendData[v4].attributes.ttFormat == 'currency') {
var v27 = v11[v4].firstChild.nodeValue;
var v33 = FormatAsDollars(v27);
} else {
if (v11[v4].firstChild.nodeValue <= 0) {
var v33 = 0;
} else {
var v33 = v11[v4].firstChild.nodeValue;
}
}
if (_global.Ylab != undefined) {
var v28 = ' ' + _global.Ylab;
} else {
var v28 = '';
}
_root.detail_mc['ctn_detailArea' + v3 * 3 + v4].dataValue = v30 + v33 + v31 + v28;
}
++v4;
}
++v3;
}
_global.set_background();
};
_global.start_Bars = function () {
var v14 = _global.maxYrange;
var v22 = _global.minYrange;
var v25 = v14 / 2;
var v26 = v25 / 2;
var v8 = 1;
var v9 = true;
var v27 = 0;
var v17 = _global.graphHeight;
var v24 = _global.graphWidth;
var v15 = _global.barWidth;
if (_global.showYlab != 'false') {
if (_global.YlabCount == undefined) {
var v10 = int(v17 / 30);
var v21 = 30;
} else {
var v10 = _global.YlabCount;
var v21 = (Number(v17) - 3) / Number(v10);
}
var v4 = 0;
while (v4 <= v10) {
var v12 = ((Number(v14) - Number(v22)) / v10) * (v10 - v4) + Number(v22);
var v6 = new TextFormat();
v6.bold = true;
v6.font = 'Arial';
v6.size = 10;
v6.align = 'right';
if (_global.YlabColor != undefined) {
v6.color = _global.YlabColor;
} else {
v6.color = 8355711;
}
_root.createTextField('tf_ylab_' + v4, 300 + v4, 2, 5 + int(v21 * v4), 49, 15);
_root['tf_ylab_' + v4].setNewTextFormat(v6);
if (_global.YlabFormat != undefined) {
_root['tf_ylab_' + v4].text = FormatNumber(v12, _global.YlabFormat);
} else {
var v20 = (Number(v12) / 100) * 100;
var v16 = Math.round(100 * Number(v20));
_root['tf_ylab_' + v4].text = Math.round(Number(v16) / 100);
}
if (v4 > 0 && v4 <= v10) {
_root.ctn_graph.attachMovie('ctn_horiz_div', 'ctn_horiz_div' + v4, 100 + v4);
_root.ctn_graph['ctn_horiz_div' + v4]._y = 8 + int(v21 * v4);
}
++v4;
}
}
_root.createEmptyMovieClip('x_labels', 4);
_root.x_labels._x = 65;
_root.x_labels._y = Number(v17) + 13;
_root.createEmptyMovieClip('detail_mc', 10);
_root.detail_mc._x = 65;
_root.detail_mc._y = Number(v17) + 10;
var v3 = 0;
while (v3 < dataSet.length) {
var v7 = _global.dataSet[v3].childNodes;
var v23 = v7[0].firstChild.nodeValue;
if (_global.spacing == '0') {
var v19 = v24 - v15 - 15;
var v18 = _global.dataSet.length - 1;
var v11 = Math.round(v3 * v19 / v18);
} else {
var v11 = v3 * _global.spacing;
}
var v5 = 0;
while (v5 <= firstData.length) {
var firstData = _global.dataSet[0].childNodes;
var v13 = firstData[0].firstChild.nodeValue;
_global['ypos_' + v5] = (v17 / v14) * v7[v5].firstChild.nodeValue;
++v5;
}
_root.x_labels.attachMovie('ctn_Xline', 'ctn_Xline' + v3, -300 - v3);
_root.x_labels['ctn_Xline' + v3]._x = v11;
if (_global.labFreq != undefined) {
if (_global.labFreq == 1) {
v9 = true;
} else {
if (v8 == 1) {
++v8;
v9 = true;
} else {
if (v8 == _global.labFreq) {
v8 = 1;
v9 = false;
} else {
++v8;
v9 = false;
}
}
}
}
if (v9) {
_root.x_labels['ctn_Xline' + v3].tf_bottom.autoSize = true;
_root.x_labels['ctn_Xline' + v3].tf_bottom.text = _global.dataSet[v3].attributes.dataInterval;
_root.x_labels['ctn_Xline' + v3].tf_bottom._y = _root.x_labels['ctn_Xline' + v3].tf_bottom._height;
_root.x_labels['ctn_Xline' + v3].tf_bottom._x += v15 / 2;
if (_global.dataSet[v3].attributes.dataSection != undefined) {
_root.x_labels['ctn_Xline' + v3].tf_bottomSection.autoSize = true;
_root.x_labels['ctn_Xline' + v3].tf_bottomSection.text = _global.dataSet[v3].attributes.dataSection;
_root.x_labels['ctn_Xline' + v3].tf_bottomSection._y = _root.x_labels['ctn_Xline' + v3].tf_bottomSection._height;
_root.x_labels['ctn_Xline' + v3].tf_bottomSection._x += v15 / 2;
} else {
_root.x_labels['ctn_Xline' + v3].tf_bottomSection.text = '';
}
} else {
_root.x_labels['ctn_Xline' + v3].tf_bottomSection.text = '';
_root.x_labels['ctn_Xline' + v3].tf_bottom.text = '';
}
_root.detail_mc.attachMovie('ctn_detail', 'ctn_detail' + v3, 900 - v3);
_root.detail_mc['ctn_detail' + v3].ctn_color.gotoAndStop(_global.barColor);
_root.detail_mc['ctn_detail' + v3].ctn_color._height = Math.round(_global.ypos_0);
_root.detail_mc['ctn_detail' + v3].btn_hit._height = Math.round(_global.ypos_0);
_root.detail_mc['ctn_detail' + v3].ctn_color._width = _global.barWidth;
_root.detail_mc['ctn_detail' + v3].btn_hit._width = _global.barWidth;
_root.detail_mc['ctn_detail' + v3]._x = v11;
_root.detail_mc['ctn_detail' + v3].dataValue = v7[0].firstChild.nodeValue;
++v3;
}
_global.set_background();
};
_global.start_Pies = function () {
var v8 = 1;
var v9 = true;
var v7 = 0;
_root.ctn_bg._alpha = 0;
_root.ctn_graph._alpha = 0;
_root.ctn_loading.gotoAndStop(2);
_root.createEmptyMovieClip('pie_mc', 12);
_root.pie_mc._x = 120;
_root.pie_mc._y = 110;
var v3 = 0;
while (v3 < dataSet.length) {
var v6 = _global.dataSet[v3].childNodes;
var v5 = v6[0].firstChild.nodeValue;
_root.pie_mc.createEmptyMovieClip('pie_mc_area' + v3, 20 + v3);
_root.pie_mc['pie_mc_area' + v3]._rotation = v7;
_root.pie_mc['pie_mc_area' + v3].sliceNum = v3;
_root.pie_mc['pie_mc_area' + v3].attachMovie('mc_pie_div', 'mc_pie_div' + v3, v3 * 1000 + 100);
_root.pie_mc['pie_mc_area' + v3]['mc_pie_div' + v3]._rotation = -3.6;
var v4 = 0;
while (v4 < v5) {
_root.pie_mc['pie_mc_area' + v3].attachMovie('mc_pie_slice', 'mc_pie_slice' + v4, v3 * 1000 + v4);
_root.pie_mc['pie_mc_area' + v3]['mc_pie_slice' + v4]._rotation = v4 * 3.6;
_root.pie_mc['pie_mc_area' + v3]['mc_pie_slice' + v4].gotoAndStop(v3 + 1);
_root.pie_mc['pie_mc_area' + v3]['mc_pie_slice' + v4].mc_pie_color.gotoAndStop(_global.barColor);
_root.pie_mc['pie_mc_area' + v3]['mc_pie_slice' + v4].dataValue = v6[0].firstChild.nodeValue;
++v4;
}
_root.pie_mc.attachMovie('mc_pie_key', 'mc_pie_key' + v3, 1100 + v3);
_root.pie_mc['mc_pie_key' + v3].gotoAndStop(v3 + 1);
_root.pie_mc['mc_pie_key' + v3].mc_pie_key_color.gotoAndStop(_global.barColor);
_root.pie_mc['mc_pie_key' + v3].tf_key.text = _global.dataSet[v3].attributes.dataInterval;
_root.pie_mc['mc_pie_key' + v3]._x = 120;
_root.pie_mc['mc_pie_key' + v3]._y = -100 + v3 * 20;
_root.pie_mc['mc_pie_key' + v3].sliceNum = v3;
v7 += v5 * 3.6;
++v3;
}
};
Stage.align = 'TL';
Stage.scaleMode = 'noScale';
_global.loadXML = function () {
data_xml = new XML();
data_xml.onLoad = _global.start_Graph;
data_xml.load(_global.dataURL + '?prevCache=' + (new Date()).getTime());
data_xml.ignoreWhite = true;
};
var loaderInterval = setInterval(loadCheck, 300000);
_global.start_Graph = function (success) {
if (success == true) {
_global.topData = data_xml.firstChild.childNodes;
_global.legendData = _global.topData[0].childNodes;
_global.dataSet = data_xml.firstChild.firstChild.nextSibling.childNodes;
_global.spacing = _global.topData[0].attributes.spacing;
_global.disp = _global.topData[0].attributes.disp;
_global.labFreq = _global.topData[0].attributes.labFreq;
_global.showYlab = _global.topData[0].attributes.showYlab;
_global.showYlab_right = _global.topData[0].attributes.showYlab_right;
_global.YlabFormat = _global.topData[0].attributes.YlabFormat;
_global.YlabFormat_right = _global.topData[0].attributes.YlabFormat_right;
_global.Ylab = _global.topData[0].attributes.Ylab;
_global.barColor = _global.topData[0].attributes.barColor;
_global.graphStyle = _global.topData[0].attributes.graphStyle;
_global.barWidth = _global.topData[0].attributes.barWidth;
_global.graphWidth = _global.topData[0].attributes.graphWidth;
_global.hitSpaceFull = _global.topData[0].attributes.hitSpaceFull;
_global.showVertLine = _global.topData[0].attributes.showVertLine;
_global.annotations = _global.topData[0].attributes.annotations;
_global.YlabColor = _global.topData[0].attributes.YlabColor;
_global.YlabColor_right = _global.topData[0].attributes.YlabColor_right;
_global.YlabCount = _global.topData[0].attributes.YlabCount;
if (_global.topData[0].attributes.graphHeight == undefined) {
_global.graphHeight = 140;
} else {
_global.graphHeight = _global.topData[0].attributes.graphHeight;
}
_global.maxYrange = _global.topData[1].attributes.maxYrange;
_global.maxYrange_right = _global.topData[1].attributes.maxYrange_right;
_global.minYrange = _global.topData[1].attributes.minYrange;
_global.minYrange_right = _global.topData[1].attributes.minYrange_right;
_global.lineColors = new Array(14519845, 10738480, 7315400);
if (_global.graphStyle == 'pie') {
_global.start_Pies();
} else {
if (_global.graphStyle == 'bars') {
_global.start_Bars();
} else {
if (_global.graphStyle == 'lines') {
_global.start_Lines();
}
}
}
}
};
_global.set_background = function () {
_root.ctn_loading.gotoAndStop(2);
var v3 = new flash.geom.Rectangle(10, 10, 719, 113);
_root.ctn_bg.scale9Grid = v3;
if (_global.graphWidth != undefined) {
if (_global.graphWidth == '0') {
_root.ctn_bg._width = _root.lines_mc._width;
_root.ctn_graph_mask._width = _root.lines_mc._width - 12;
_root.ctn_tf_right._x = _root.ctn_graph_mask._width + 60;
} else {
_root.ctn_bg._width = _global.graphWidth;
_root.ctn_graph_mask._width = _global.graphWidth;
_root.ctn_tf_right._x = _root.ctn_graph_mask._width + 60;
}
}
if (_global.graphHeight != undefined) {
_root.ctn_bg._height = _global.graphHeight;
_root.ctn_graph_mask._height = _global.graphHeight;
}
};
_global.loadXML();
Object.prototype.callOutOvr = function () {
var v6 = _root.detail_mc.getNextHighestDepth();
this.swapDepths(v6);
var v4 = false;
if (this._y < 20 - _global.graphHeight) {
v4 = true;
}
if (this.mc_annotateFlag.annotation == undefined) {
this.attachMovie('ctn_callOut', 'callOut', 1);
if (_global.graphStyle == 'bars') {
this.callOut._y = -this.ctn_color._height;
} else {
if (v4) {
this.callOut._y = 4;
} else {
this.callOut._y = -20;
}
}
this.callOut.tf_callOut.autoSize = true;
this.callOut.tf_callOut.text = this.dataValue;
var v7 = new flash.geom.Rectangle(1, 1, 8, 8);
this.callOut.mc_callOut_bg.scale9Grid = v7;
this.callOut.mc_callOut_bg._width = this.callOut.tf_callOut._width + 7;
var v8 = this._x / _root.ctn_bg._width;
var v9 = this.callOut.mc_callOut_bg._width;
this.callOut._x = int(-(v9 * v8));
if (_global.graphStyle == 'lines') {
this.callOut.mc_callOut_handle._x = -this.callOut._x;
if (v4) {
this.callOut.mc_callOut_handle._y = 1;
this.callOut.mc_callOut_handle.gotoAndStop(2);
}
} else {
this.callOut.mc_callOut_handle._alpha = 0;
}
} else {
this.mc_annotateFlag.gotoAndStop(3);
this.mc_annotateFlag.mc_txt.tf_callOut.autoSize = true;
this.mc_annotateFlag.mc_txt.tf_callOut.text = this.dataValue;
this.mc_annotateFlag.mc_txt.tf_annotation.autoSize = true;
this.mc_annotateFlag.mc_txt.tf_annotation.text = this.mc_annotateFlag.annotation;
this.mc_annotateFlag.btn._y = -42;
this.mc_annotateFlag.btn._height = 44;
this.mc_annotateFlag.btn._width = this.mc_annotateFlag.mc_txt._width + 2;
var v5 = new flash.geom.Rectangle(1, 1, 10, 5);
this.mc_annotateFlag.mc_annotationDetails.scale9Grid = v5;
this.mc_annotateFlag.mc_annotationDetails._y = -41;
this.mc_annotateFlag.mc_annotationDetails._height = 36;
this.mc_annotateFlag.mc_annotationDetails._width = this.mc_annotateFlag.mc_txt._width + 2;
var v8 = this._x / _root.ctn_bg._width;
var v9 = this.mc_annotateFlag._width;
this.mc_annotateFlag._x = int(-(v9 * v8));
this.mc_annotateFlag.mc_annotation_handle._x = -this.mc_annotateFlag._x;
}
this.ctn_color._alpha = 100;
if (_global.graphStyle == 'bars') {
this.ctn_color.gotoAndStop('white');
}
if (_global.graphStyle == 'lines') {
this.mc_line._alpha = 100;
this.mc_line._height = this.btn_hit._height;
this.mc_line._y = this.btn_hit._y;
}
};
Object.prototype.callOutOut = function () {
if (this.mc_annotateFlag.annotation == undefined) {
this.callOut.removeMovieClip();
} else {
this.mc_annotateFlag.btn._width = 14;
this.mc_annotateFlag.btn._height = 21;
this.mc_annotateFlag.btn._x = -4;
this.mc_annotateFlag.btn._y = -19;
this.mc_annotateFlag.mc_txt.tf_callOut.text = '';
this.mc_annotateFlag.mc_txt.tf_annotation.text = '';
this.mc_annotateFlag.gotoAndStop(2);
this.mc_annotateFlag.mc_annotationDetails._y = -18;
this.mc_annotateFlag.mc_annotationDetails._height = 13;
this.mc_annotateFlag.mc_annotationDetails._width = 12;
this.mc_annotateFlag._x = 4;
this.mc_annotateFlag.mc_annotation_handle._x = -3;
}
this.mc_line._alpha = 0;
if (_global.graphStyle == 'lines') {
this.ctn_color._alpha = 0;
} else {
if (_global.graphStyle == 'bars') {
this.ctn_color.gotoAndStop(_global.barColor);
}
}
};
Object.prototype.callOutHit = function () {
if (_global.annotations == 'true') {
if (_global.graphStyle == 'lines') {
if (this.mc_annotateFlag.annotation == undefined) {
this.attachMovie('ctn_addAnnotation', 'addAnnotation', 3);
this.addAnnotation._y = this._ymouse;
if (_root.ctn_bg._xmouse > _root.ctn_bg._width - 90) {
this.addAnnotation._x += -90;
}
}
}
}
};
Object.prototype.addAnnotation = function () {
getURL(this.mc_annotateFlag.annotationLink, '_blank');
this.cnclAnnotation();
};
Object.prototype.editAnnotation = function () {
getURL(this.mc_annotateFlag.annotationLink, '_blank');
};
Object.prototype.cnclAnnotation = function () {
this.addAnnotation.removeMovieClip();
this.callOutOut();
};
}
movieClip 100 {
}
movieClip 101 {
}
movieClip 102 {
}
movieClip 103 {
}
movieClip 108 {
}
movieClip 109 {
}
movieClip 112 {
frame 1 {
stop();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment