Button to remove movieclip and jump to new scene error
I am not a developer so pardon the dumb question.
I have 2 scenes. (really many more than 2, but for this question we will say 2 scenes).
Scene 1 links to Scene 2.
In my scene 2 I have a scrollpane with two buttons. Each button links to a frame in the timeline. That's working great after I found some answers on this board. Here is the scrollpane code:
import fl.containers.ScrollPane;
import fl.controls.ScrollPolicy;
import fl.controls.DataGrid;
import fl.data.DataProvider;
var aSp:ScrollPane = new ScrollPane();
var aBox:MovieClip = new MovieClip();
aSp.source = member_snapshot_tiles;
aSp.setSize(1340, 170);
aSp.move(570, 110);
addChild(aSp);
Now I need to have a button that goes back to Scene 1. The button works but the scrollpane from Scene 2 appears in Scene 1.
I found this snippet on the board:
btnHeim.addEventListener(MouseEvent.CLICK,heimClick);
function heimClick(e:MouseEvent):void {
loader.unload();
gotoAndStop(1,"Mainpage");
}
and modified it:
button_54.addEventListener(MouseEvent.CLICK,heimClick);
function heimClick(e:MouseEvent):void {
member_snapshot_tiles.removeChild(ScrollPane);
MovieClip(this.root).gotoAndPlay(1, "vistaroster");
}
Unfortunately I am not a developer so I can't seem to find the right combo of labels to make this work. How can I add a button that removes the scrollpane and returns the user to Scene 1?
