# Conflict with definition in namespace internal- noob in distress

**URL:** <https://forum.kirupa.com/t/conflict-with-definition-in-namespace-internal-noob-in-distress/298792>\
**Category:** Uncategorized\
**Created:** [October 25, 2009, 11:24am UTC](https://forum.kirupa.com/t/conflict-with-definition-in-namespace-internal-noob-in-distress/298792 "2009-10-25T11:24:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GoldenSilence](https://avatars.discourse-cdn.com/v4/letter/g/958977/32.png) [@GoldenSilence](https://forum.kirupa.com/u/GoldenSilence)\
**Post date:** [October 25, 2009, 11:24am UTC](https://forum.kirupa.com/t/conflict-with-definition-in-namespace-internal-noob-in-distress/298792/1 "2009-10-25T11:24:12Z")

</div>

I am fairly new to programming and i have gone through a few flash cs4 as3 tutorials and recently i have started to try and alter them. The one i need help with is a number guessing game where you guess a number between 1 and 10, and i am trying to change it to a color guessing game, where you guess either “red” or “blue”.

I keep getting an error in line 5 “var red = true;”. The error is 1151: A conflict exists with the definition red in namespace internal. There is also a “Warning:3596: Duplicate variable definition” for the same line.  
Here is the code:

var random = floor(Math.random()\*2);  
if(random == 0){  
var red = false;  
}else if (random == 1){  
var red = true;  
}

guess\_btn.addEventListener(MouseEvent.CLICK, onGuessClick);

function onGuessClick(event){  
var guess = String(guess\_txt.text)

```
if (guess == "red" && red == true){
	 response_txt.text = "Red is the correct answer.";
}else if (guess == "red" && red == false){
	response_txt.text = "Red is not the correct answer.";
}else if(guess == "blue" && red == false){
	response_txt.text = "Blue is the correct answer.";
}else if (guess == "blue" && red == true){
	response_txt.text = "Blue is not the correct answer.";
}else if (guess != "blue" || guess != "red"){
	response_txt.text = "I said red or blue!";
}

```

}

Any help is much appreciated.
