I have tried a million things with no success. I have a set of main buttons that shows a shared stage. Inside the stage are buttons and a scrollpane. Those buttons load a clip into the scrollpane. I’m trying to use the shared stage once, but use it for say 10 buttons. I need to target the sub buttons in the shared stage to load different info depending on what main button is pushed. I keep getting this error:
TypeError: Error #1010: A term is undefined and has no properties. at MethodInfo-249()
This is what I have so far:
// MAIN BUTTONS
button1.setLabel("Button One");
button1.addEventListener(MouseEvent.CLICK, button1Clicked);
function button1Clicked(event:MouseEvent) {
this.stageOne.myScrollPane.source = sharedStage;
this.stageOne.dyanmicTitle.text = "Stage One";
thisTest("Green");
}
button2.setLabel("Button Two");
button2.addEventListener(MouseEvent.CLICK, button2Clicked);
function button2Clicked(event:MouseEvent) {
this.stageOne.myScrollPane.source = sharedStage;
this.stageOne.dyanmicTitle.text = "Stage Two";
thisTest("Red");
}
// SHARED SUB BUTTONS ON LOADED CLIP (this is where the problem occurs)
this.stageOne.sub_btn.setLabel("Shared Button");
function thisTest(stage2Load){
this.stageOne.sub_btn.addEventListener(MouseEvent.CLICK, subButtonClicked);
function subButtonClicked(event:MouseEvent) {
if (stage2Load == "Green"){
this.stageOne.myScrollPane.source = green;
this.stageOne.dyanmicTitle.text = "GREEN";
}
if (stage2Load == "Red"){
this.stageOne.myScrollPane.source = red;
this.stageOne.dyanmicTitle.text = "RED";
}
}
}