Adding and removing loader from the stage

This is becoming very frustrating as I have been getting various answers from various sources. I’m going to try to simply post my situation here as I never had a problem doing this in AS2 but AS3 is a different story so here goes.

I have a main.swf which has frame labels on the main timeline

they are 6 different frame labels:


the event listeners for the home, projects and contact btns are in the actions layer of the main timeline, where the buttons first appear on the stage.

the event listeners for the galleries are inside a movieclip which contains the buttons for all the galleries.

The galleries are all external.swfs gallery1.swf gallery2.swf (etc)

below is the AS for the gallery buttons that move the playhead to the frames


btn_gallery1.addEventListener(MouseEvent.CLICK, gallery1Click);

function gallery1Click (e:MouseEvent):void


btn_gallery2.addEventListener(MouseEvent.CLICK, gallery2Click);

function gallery2Click (e:MouseEvent):void


btn_gallery3.addEventListener(MouseEvent.CLICK, gallery3Click);

function gallery3Click (e:MouseEvent):void


btn_gallery4.addEventListener(MouseEvent.CLICK, gallery4Click);

function gallery4Click (e:MouseEvent):void


[COLOR=Red]Problem: soon as you open any gallery the loader remains on the stage, I need to have a function that will remove any loader from the stage before opening any links. Besides this the event listeners for the other non gallery buttons are on the main timeline as mentioned, I would obviously need to include those buttons in this function as well.

This is very complicated for me as I remember doing this in AS2

I would simply use unloadMovieNum(1) in a btn along with loadMovieNum(1)

that always did the trick as it removed any movie in level 1 before adding a movie in level1. This is exactly waht I need to do but in AS3

any help here ???