Okay, I have completely hit a wall. Here’s what I’m after. I have two sets of radio buttons, each of which controls what loaded swf appears on stage. Then, depending on which button is clicked in group one and which button is clicked in group two, a third swf appears.
I can access the value of each radio button, and I’m passing it into a variable (I think - the trace command works) but when I drop it all together into an if/else statement, no data is passed.
Here’s the code:
//printArea is a movie clip on stage, which has dynamic mc's attached via code
var thisFront;
//function for what happens when fronts radio buttons clicked
frontListener = new Object();
frontListener.click = function(evt) {
var whichFront:String = evt.target.selection.label;
switch (whichFront) {
case "1" :
loadImage(printArea.crossSection,"xsc/O5DM_standard.swf");
descriptionFront("Standard Front");
break;
case "2" :
loadImage(printArea.crossSection,"xsc/O5DM_2-5in_light.swf");
descriptionFront("2.5 inch extended front with light");
break;
case "3" :
loadImage(printArea.crossSection,"xsc/O5DM_5in_light.swf");
descriptionFront("5 inch extended front with light");
break;
}
trace(frontsGroup.getValue());
//thisFront is the variable created above
thisFront = frontsGroup.getValue();
// and this trace tells me the value assigned to the variable
trace(thisFront);
};
frontsGroup.addEventListener("click",frontListener);
frontsGroup.setValue("0");
var thisLength;
//function for what happens when lengths radio buttons clicked
lengthListener = new Object();
lengthListener.click = function(evt) {
var whichLength:String = evt.target.selection.label;
switch (whichLength) {
case "1" :
loadImage(printArea.footprint,"lengths/o5dm_4ft.swf");
descriptionLength("4 foot length");
break;
case "2" :
loadImage(printArea.footprint,"lengths/o5dm_6ft.swf");
descriptionLength("6 foot length");
break;
}
trace(lengthsGroup.getValue());
thisLength = lengthsGroup.getValue();
trace(thisLength);
};
lengthsGroup.addEventListener("click",lengthListener);
lengthsGroup.setValue("0");
//this part doesn't work. I can't figure out why
//thisFront and thisLength are variables assigned in the above functions
if (thisFront == "1" && thisLength == "1") {
loadImage(printArea.energyData,"data/O5DM_standard_4ft.swf");
} else if (thisFront == "1" && thisLength == "2") {
loadImage(printArea.energyData,"data/O5DM_standard_6ft.swf");
}
Thanks as always for any help.