Simple question! Please Help!

Hi guys,

I have a flash file that loads [COLOR=darkgreen]external[/COLOR] images randomly onto the stage!
that part works just fine.

I have placed the code for loading images on the second frame of the flash [COLOR=darkgreen]file[/COLOR].

what I want to do is to create a button on the second frame so when the users click on it the flash file will go back on the first frame. (basically a Back Button).

I did create a button and it will go back to the first frame once its clicked…
However the image that loaded on the second frame will stay on the stage when the flash file’s gone back to the first frame.

I need to remove the image loaded on the second frame as well when it has gone back to the first frame!!

This is my code:

Actionscript Code:
[LEFT][COLOR=#0066CC]stop[/COLOR][COLOR=#66CC66]([/COLOR][COLOR=#66CC66])[/COLOR];

[COLOR=#000000]var[/COLOR] pHeight:[COLOR=#0066CC]Number[/COLOR] = [COLOR=#CC66CC]346[/COLOR];
[COLOR=#000000]var[/COLOR] pWidth:[COLOR=#0066CC]Number[/COLOR] = [COLOR=#CC66CC]263[/COLOR];

[COLOR=#000000]var[/COLOR] listLoader:URLLoader = [COLOR=#000000]new[/COLOR] URLLoader[COLOR=#66CC66]([/COLOR] [COLOR=#000000]new[/COLOR] URLRequestCOLOR=#66CC66[/COLOR] [COLOR=#66CC66])[/COLOR];
[COLOR=#000000]var[/COLOR] picLoader:Loader = [COLOR=#000000]new[/COLOR] LoaderCOLOR=#66CC66[/COLOR];

listLoader.[COLOR=#006600]addEventListener[/COLOR][COLOR=#66CC66]([/COLOR][COLOR=darkgreen]Event[/COLOR].[COLOR=#006600]COMPLETE[/COLOR], gotList[COLOR=#66CC66])[/COLOR];

[COLOR=#000000]function[/COLOR] gotListCOLOR=#66CC66[/COLOR]:[COLOR=#0066CC]void[/COLOR] [COLOR=#66CC66]{[/COLOR]
[COLOR=#000000]var[/COLOR] xmlData:[COLOR=#0066CC]XML[/COLOR] = [COLOR=#0066CC]XML[/COLOR]COLOR=#66CC66[/COLOR];
[COLOR=#000000]var[/COLOR] numImages:[COLOR=#0066CC]Number[/COLOR] = xmlData.[COLOR=#006600]pix[/COLOR].[COLOR=#0066CC]length[/COLOR]COLOR=#66CC66[/COLOR];

[COLOR=#000000]**var**[/COLOR] stImage:[COLOR=#0066CC]String[/COLOR] = xmlData.[COLOR=#006600]pix[/COLOR][COLOR=#66CC66][[/COLOR][COLOR=#0066CC]Math[/COLOR].[COLOR=#0066CC]floor[/COLOR][COLOR=#66CC66]([/COLOR]numImages*[COLOR=#0066CC]Math[/COLOR].[COLOR=#0066CC]random[/COLOR][COLOR=#66CC66]([/COLOR][COLOR=#66CC66])[/COLOR][COLOR=#66CC66])[/COLOR][COLOR=#66CC66]][/COLOR].[COLOR=#0066CC]toString[/COLOR][COLOR=#66CC66]([/COLOR][COLOR=#66CC66])[/COLOR];

picLoader.[COLOR=#006600]contentLoaderInfo[/COLOR].[COLOR=#006600]addEventListener[/COLOR][COLOR=#66CC66]([/COLOR]Event.[COLOR=#006600]COMPLETE[/COLOR], gotPic[COLOR=#66CC66])[/COLOR];
picLoader.[COLOR=#0066CC]load[/COLOR][COLOR=#66CC66]([/COLOR] [COLOR=#000000]**new**[/COLOR] URLRequest[COLOR=#66CC66]([/COLOR]stImage[COLOR=#66CC66])[/COLOR] [COLOR=#66CC66])[/COLOR];

listLoader.[COLOR=#006600]removeEventListener[/COLOR][COLOR=#66CC66]([/COLOR]Event.[COLOR=#006600]COMPLETE[/COLOR], gotList[COLOR=#66CC66])[/COLOR];

[COLOR=#66CC66]}[/COLOR]

[COLOR=#000000]function[/COLOR] gotPicCOLOR=#66CC66[/COLOR]:[COLOR=#0066CC]void[/COLOR] [COLOR=#66CC66]{[/COLOR]
[COLOR=#000000]var[/COLOR] thisBmp:Bitmap = BitmapCOLOR=#66CC66[/COLOR];
thisBmp.[COLOR=#006600]x[/COLOR] = [COLOR=#CC66CC]28[/COLOR];
thisBmp.[COLOR=#006600]y[/COLOR] = [COLOR=#CC66CC]72[/COLOR];
[COLOR=#000000]var[/COLOR] thisWidth:[COLOR=#0066CC]Number[/COLOR] = thisBmp.[COLOR=#0066CC]width[/COLOR];
[COLOR=#000000]var[/COLOR] thisHeight:[COLOR=#0066CC]Number[/COLOR] = thisBmp.[COLOR=#0066CC]height[/COLOR];

thisBmp.[COLOR=#006600]scaleX[/COLOR] = pWidth/thisWidth;
thisBmp.[COLOR=#006600]scaleY[/COLOR] = pHeight/thisHeight;
addChild[COLOR=#66CC66]([/COLOR]thisBmp[COLOR=#66CC66])[/COLOR];

picLoader.[COLOR=#006600]contentLoaderInfo[/COLOR].[COLOR=#006600]removeEventListener[/COLOR][COLOR=#66CC66]([/COLOR]Event.[COLOR=#006600]COMPLETE[/COLOR], gotPic[COLOR=#66CC66])[/COLOR];

[COLOR=#66CC66]}[/COLOR]

[COLOR=#808080]//////////////Back button function//////////////////[/COLOR]

btn_back.[COLOR=#006600]addEventListener[/COLOR][COLOR=#66CC66]([/COLOR]MouseEvent.[COLOR=#006600]MOUSE_DOWN[/COLOR], nClick2[COLOR=#66CC66])[/COLOR];

[COLOR=#808080]//— next button timeline control —\[/COLOR]
[COLOR=#000000]function[/COLOR] nClick2COLOR=#66CC66[/COLOR]:[COLOR=#0066CC]void[/COLOR][COLOR=#66CC66]{[/COLOR]
[COLOR=#0066CC]gotoAndPlay[/COLOR]COLOR=#66CC66[/COLOR];
[COLOR=#66CC66]}[/COLOR]
[/LEFT]

any help will be much appreciated.

Thanks in advance.