PDA

View Full Version : Radiobutton Groups -->Array-->Movieclip


cpeckens
05-20-2007, 10:37 PM
I have four radiobutton groups. I want the selections to create an array. I want the array to call a movieclip depending on its data. If I can skip the array step and call the movie straight from the four selections from the radio button groups, Im all for it. Here is the code I've been working with. Everytime I trace the array, I just get undefined. Please help.

//Establish Variables
var Outfit1A:MovieClip;
var Outfit1B:MovieClip;
var Outfit2A:MovieClip;
var Outfit2B:MovieClip;
var Outfit3A:MovieClip;
var Outfit3B:MovieClip;
var Outfit4A:MovieClip;
var Outfit4B:MovieClip;
var dressUp:MovieClip;
var oufitArray:Array = new Array();


/*/Setup Listeners
headGroup.addEventListener("click", createArray);
topGroup.addEventListener("click", createArray);
bottomGroup.addEventListener("click", createArray);
accessoryGroup.addEventListener("click", createArray)
/*/
createOutfit.addEventListener("click", dressBarbie);

//Set Background
dressUp.gotoAndStop(1);
Outfit1A.gotoAndStop(1);

//Set button functions
createOutfit.onRelease = dressBarbie;
lifeStory.onRelease = issueMovie;


//Set function parameters
function dressBarbie():Void {
outfitArray.push(headGroup.selection.data);
outfitArray.push(topGroup.selection.data);
outfitArray.push(bottomGroup.selection.data);
outfitArray.push(accessoryGroup.selection.data);
trace(outfitArray);
if (outfitArray == (head1, top1, bottom1, accessory1)) {
dressup.gotoAndStop (2);
Outfit1A.gotoAndPlay (2);
}
}

/*/function createArray():Void {
outfitArray.push(headGroup.selection.data);
outfitArray.push(topGroup.selection.data);
outfitArray.push(bottomGroup.selection.data);
outfitArray.push(accessoryGroup.selection.data);
}
/*/