Hi, I am new to flash and came across your forum while trying to solve an issue I have with flash.
A quick review of the project, I am importing information from an xml file into an array. From there I have passed the information from the array to a variable.
I find it that when I try to match the variable to a string letter, that it is not running through the case switch properly and going straight to the default bit. I have tried numerous solution to check where the problem lies;
I have trace the actual position of the array to check if it is the correct letter I am trying to match.
Did a length check on the variable that it is only 1, and not containing any spaces
When I hardcode the letter into the variable, the case works perfectly.
Any idea on why this is happening would greatly be apreciated. I have pasted a sample of the code below;
var switchTest = initialSlide_array[1];
switch (switchTest) { //switch case used to check template type
case “A”:
trace(“template A”);
template_A(); // calls template function
break;
case “B”:
trace(“template B”);
break;
case “C”:
trace(“template C”);
break;
default :
trace(“testing case default”);
break;
}//end of switch case statement