Problem in setting RGB

What I’m trying to do right now is to extract a numerical value from an XML file and change the color of an object accordingly. Here’s what I have wrote:

onClipEvent (mouseMove) {
var gdp = 0;
for (var i = 0; i<; i++) {
if (* == “Asia”) {
var asia =*.childNodes;
for (var j = 0; j<asia.length; j++) {
if (asia[j] == “South Korea”) {
var korea = asia[j].childNodes;
for (var k = 0; k<korea.length; k++) {
if (korea[k].nodeName == “GDP” && korea[k].attributes.year == _root.year) {
gdp = korea[k].firstChild.nodeValue;
colorobj = new Color(this.korea);
var colorValue = (gdp/5000)*255;
var R = (255 - colorValue)65536;
var G = colorValue
var B = 0;

The looping part works fine. I could get the value I wanted. The color change part also worked fine by itself. When I put a certain number in gdp and the color was set successfully.
The problem is when I combine these two together. Not only korea’s color wasn’t changed, but trace(colorobj.getRGB()); showed undefined instead of displaying the original color’s code.
Can anyone tell me what’s wrong? I’m really stuck…