Frame 1
function updateNuPreview() {
previewColor.setRGB(ConvertToHex(nextColor));
picHex.text = "#" + ConvertToHex(nextColor).substr(2, 6).toUpperCase();
shadowHex.text = picHex.text;
shadowHex2.text = picHex.text;
shadowHex3.text = picHex.text;
shadowHex4.text = picHex.text;
}
function reRender() {
markers = new Array();
for (var _loc3 in eval (colorBox)) {
if (colorBox[_loc3].isPointer == true) {
markers.push({cent:int(colorBox[_loc3]._x / 3), col:ConvertToHex(colorBox[_loc3].ch.getTransform())});
}
}
render();
}
function ConvertToHex(rgb) {
newhex1 = Number(rgb.rb).toString(16);
newhex2 = Number(rgb.gb).toString(16);
newhex3 = Number(rgb.bb).toString(16);
while (newhex1.length < 2) {
newhex1 = "0" + newhex1;
}
while (newhex2.length < 2) {
newhex2 = "0" + newhex2;
}
while (newhex3.length < 2) {
newhex3 = "0" + newhex3;
}
newC = (("0x" + newhex1.toString()) + newhex2.toString()) + newhex3.toString();
return(newC);
}
function render() {
c = 0;
mySO = SharedObject.getLocal("savedGrad");
mySO.data.savedColors = new Array();
markers.sortOn("cent", 18);
if (markers[0].cent != 100) {
markers.unshift({cent:100, col:markers[0].col});
}
if (markers[markers.length - 1].cent != 0) {
markers.push({cent:0, col:markers[markers.length - 1].col});
}
_root.colorBox = this.createEmptyMovieClip("sampleBox", 2);
colorBox._x = 20;
colorBox._y = 80;
var _local4 = 0;
while (_local4 < 100) {
var _local7 = colorBox.createEmptyMovieClip("colourSeg" + _local4, 10 + _local4);
_local7._x = _local4 * 3;
_local7.beginFill(0, 100);
_local7.lineStyle(0.1, 0, 0);
_local7.moveTo(0, 0);
_local7.lineTo(3, 0);
_local7.lineTo(3, 50);
_local7.lineTo(0, 50);
_local7.lineTo(0, 0);
getNextColour(_local4, c, _local7);
_local7.onRelease = function () {
var _local3 = this.ch.getRGB();
var _local2 = colorBox.attachMovie("pointer", "pointer" + (this._x + 500), this._x + 500);
_local2.ch = new Color(_local2.block);
_local2.ch.setRGB(_local3);
_local2._x = this._x;
_local2._y = 50;
_local2.isPointer = true;
};
_local7.onRollOver = function () {
_root.colourPicker = _root.attachMovie("pickerCursor", "picker", 999, {_x:_root._xmouse, _y:_root._ymouse});
_root.showPicker = true;
colourPicker.onEnterFrame = function () {
this._x = int(_root._xmouse);
this._y = int(_root._ymouse);
Mouse.hide();
if (!showPicker) {
this.removeMovieClip();
Mouse.show();
}
};
};
_local7.onRollOut = function () {
_root.showPicker = false;
};
_local4++;
}
var _local3 = 0;
while (_local3 < markers.length) {
var _local5 = colorBox.attachMovie("pointer", "pointer" + _local3, _local3 + 200);
_local5.ch = new Color(_local5.block);
_local5.ch.setRGB(markers[_local3].col);
_local5._x = markers[_local3].cent * 3;
_local5._y = 50;
_local5.isPointer = true;
mySO.data.savedColors.push({cent:markers[_local3].cent, col:markers[_local3].col});
_local3++;
}
buildString();
mySO.flush();
delete mySO;
}
function buildString() {
covArray = output.text.split("");
var _local3 = (bolden ? "<B>" : "");
var _local4 = (bolden ? "[B]" : "");
_local3 = _local3 + (ital ? "<I>" : "");
_local4 = _local4 + (ital ? "[I]" : "");
trace("");
var _local1 = 0;
while (_local1 < covArray.length) {
var _local5 = int(((_local1 / covArray.length) * 100) + (50 / covArray.length));
var _local2 = ConvertToHex(sampleBox["colourSeg" + _local5].ch.getTransform());
_local2 = "#" + _local2.substr(2, 6);
if ((covArray[_local1] == " ") || (covArray[_local1] == "^")) {
_local3 = _local3 + "<font color='#ffffff'>^</font>";
_local4 = _local4 + " ";
} else {
_local3 = _local3 + (((("<font color='" + _local2) + "'>") + covArray[_local1]) + "</font>");
_local4 = _local4 + (((("[COLOR=" + _local2) + "]") + covArray[_local1]) + "[/COLOR]");
}
_local1++;
}
_local3 = _local3 + (ital ? "</I>" : "");
_local4 = _local4 + (ital ? "[/I]" : "");
_local3 = _local3 + (bolden ? "</B>" : "");
_local4 = _local4 + (bolden ? "[/B]" : "");
output.htmlText = _local3 + "</b>";
bbcode.text = _local4;
}
function getNextColour(totalCent, segCent, mc) {
var _local2 = {};
var _local9 = {};
var _local8 = 0;
_local8 = 0;
while (_local8 < markers.length) {
_local2 = markers[_local8];
if (_local2.cent <= totalCent) {
break;
}
_local8++;
}
if (totalCent == _local2.cent) {
c = 0;
} else {
c++;
}
_local9 = markers[_local8 - 1];
var _local11 = _local9.cent - _local2.cent;
var _local4 = getTrans(_local2.col);
var _local3 = getTrans(_local9.col);
var _local1 = {};
for (_local8 in _local3) {
_local1[_local8] = _local3[_local8] - _local4[_local8];
}
var _local6 = c / _local11;
var _local5 = {};
for (_local8 in _local1) {
_local5[_local8] = _local4[_local8] + (_local6 * _local1[_local8]);
}
mc.ch = new Color(mc);
mc.ch.setTransform(_local5);
}
stop();
boldBtn.onRelease = function () {
_root.bolden = (_root.bolden ? false : true);
this._alpha = (_root.bolden ? 100 : 40);
buildString();
};
boldBtn._alpha = (_root.bolden ? 100 : 40);
itBtn.onRelease = function () {
_root.ital = (_root.ital ? false : true);
this._alpha = (_root.ital ? 100 : 40);
buildString();
};
itBtn._alpha = (_root.ital ? 100 : 40);
picHex.onChanged = function () {
var _local3 = false;
if ((picHex.text.length == 7) && (picHex.text.substr(0, 1) == "#")) {
picHex.text = picHex.text.toUpperCase();
_local3 = true;
} else if ((picHex.text.length == 6) && (picHex.text.substr(0, 1) != "#")) {
picHex.text = "#" + picHex.text.toUpperCase();
_local3 = true;
}
shadowHex.text = picHex.text;
shadowHex2.text = picHex.text;
shadowHex3.text = picHex.text;
shadowHex4.text = picHex.text;
if (_local3) {
previewColor.setRGB("0x" + shadowHex.text.substr(1, 6));
var _local2 = _global.getTrans("0x" + shadowHex.text.substr(1, 6));
rb.arrow._x = (_local2.rb / 255) * 155;
gb.arrow._x = (_local2.gb / 255) * 155;
bb.arrow._x = (_local2.bb / 255) * 155;
nextColor.rb = _local2.rb;
nextColor.gb = _local2.gb;
nextColor.bb = _local2.bb;
updateNuPreview();
}
};
_global.getTrans = function (hex) {
var _local3 = hex >> 16;
var _local2 = hex - (_local3 << 16);
var _local1 = _local2 >> 8;
var _local4 = _local2 - (_local1 << 8);
return({ra:0, ga:0, ba:0, rb:_local3, gb:_local1, bb:_local4, aa:100, ab:0});
};
_global.rgbToHex = function (r, g, b) {
return(((r << 16) | (g << 8)) | b);
};
addBtn.onRelease = function () {
if (nuAdded._y > 50) {
nuAdded.removeMovieClip();
}
var _local2 = colorBox.attachMovie("pointer", "pointer" + (bump++), bump++);
_local2.ch = new Color(_local2.block);
_local2.ch.setRGB(ConvertToHex(nextColor));
_local2._x = 150;
_local2._y = 70;
_local2.isPointer = true;
_root.nuAdded = _local2;
};
var nextColor = new Object({rb:0, gb:0, bb:0});
var previewColor = new Color(nucolor);
var markers = new Array();
updateNuPreview();
bump = 600;
mySO = SharedObject.getLocal("savedGrad");
if (mySO.data.savedColors.length > 0) {
var t = 0;
while (t < mySO.data.savedColors.length) {
markers.push({cent:mySO.data.savedColors[t].cent, col:mySO.data.savedColors[t].col});
t++;
}
} else {
markers.push({cent:0, col:13369344});
markers.push({cent:100, col:204});
markers.push({cent:50, col:52224});
markers.push({cent:30, col:5623022});
}
delete mySO;
var c = 0;
render();
output.onChanged = function () {
buildString();
};
Symbol 12 MovieClip [pointer] Frame 1
maxx = 300;
if (_y == 50) {
starttext.swapDepths(999);
starttext.removeMovieClip();
}
this.onPress = function () {
this.onEnterFrame = function () {
var _local4 = _parent._xmouse;
if (_local4 > maxx) {
_local4 = maxx;
} else if (_local4 < 0) {
_local4 = 0;
}
_x = _local4;
if (this._ymouse > 45) {
removeMovieClip(this);
_root.reRender();
}
};
if (_y > 50) {
_y = 50;
starttext.swapDepths(999);
starttext.removeMovieClip();
}
};
this.onRelease = function () {
this.onEnterFrame = null;
_root.reRender();
};
this.onReleaseOutside = function () {
this.onEnterFrame = null;
_root.reRender();
};
Symbol 32 Button
on (release) {
System.setClipboard(bbcode.text);
}
Symbol 37 Button
on (release) {
System.setClipboard(bbcode.text);
}
Symbol 42 Button
on (release) {
System.setClipboard(bbcode.text);
}
Symbol 56 MovieClip Frame 1
maxx = 155;
this.onPress = function () {
this.onEnterFrame = function () {
var _local3 = _parent._xmouse;
if (_local3 > maxx) {
_local3 = maxx;
} else if (_local3 < 0) {
_local3 = 0;
}
_x = _local3;
_y = 0;
_root.nextColor[_parent._name] = (_x / 155) * 255;
_root.updateNuPreview();
};
};
this.onRelease = function () {
this.onEnterFrame = null;
};
this.onReleaseOutside = function () {
this.onEnterFrame = null;
};
_root[_parent._name].bigbar.onPress = function () {
var _local4 = this._xmouse;
if (_local4 > maxx) {
_local4 = maxx;
} else if (_local4 < 0) {
_local4 = 0;
}
_x = _local4;
_y = 0;
_root.nextColor[_parent._name] = (_x / 155) * 255;
_root.updateNuPreview();
};
_root[_parent._name].bigbar.useHandCursor = false;