Conditions

hi,

can u please tell me what’s wrong in the below script:

enter.onRelease = function() {
if (_root.productcode.text == “mining” or “agriculture” or “industry” or “chemical”) {
loadMovieNum(“test.swf”, 0);

} else {
	_root.productcode.text = "Enter the proper product code";
}

}

enter is the instance name of the button and product code is the instance name of the text field.

I am able to check with the only first condition, that is mining, when I enter agriculture or industry or chemical, its not checking the condition.

bye,
prathap

try if(_root.productcode.text == “mining” || _root.productcode.text == "agricukture || …etc…
You can replace “||” with “or” <-- no difference but the pont if that you have to put “_root.productcode.text==” in front of every product code!

hi

thank you for your reply.

I checked out all the possible ways, but everything in vain.
I am not able to check whether it fullfills 2, 3, and 4th string is entered in text field.

bye,
prathap

[AS]enter.onRelease = function() {
if (productcode.text == “mining” || productcode.text == “agriculture” || productcode.text == “industry” || productcode.text == “chemical”) {
loadMovieNum(“sunlook.swf”, 0);
} else {
productcode.text = “Enter the proper product code”;
}
};[/AS]