# Trouble with conditional statement

**URL:** https://forum.kirupa.com/t/trouble-with-conditional-statement/295957
**Category:** Uncategorized
**Created:** [September 8, 2009, 1:05am UTC](https://forum.kirupa.com/t/trouble-with-conditional-statement/295957 "2009-09-08T01:05:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lisarose](https://avatars.discourse-cdn.com/v4/letter/l/43a26b/32.png) [@lisarose](https://forum.kirupa.com/u/lisarose)
#### Post date: [September 8, 2009, 1:05am UTC](https://forum.kirupa.com/t/trouble-with-conditional-statement/295957/1 "2009-09-08T01:05:20Z")

</div>

i am trying to remove a .swf once you leave the index page. unsure of the method “contains” and how to remove the banner var or unload the var

the page variable code is

```auto
var sights:URLRequest=new URLRequest("sights.swf");

```

this defines the page loader

```auto
var pageLoader=new Loader();

```

this defines the banner loader

```auto
var bannerLoader:Loader=new Loader();
bannerLoader.load(myBanner);
stage.addChild(bannerLoader);

```

the button script to call the sights page with the condition:

```auto
sights_btn.addEventListener(MouseEvent.CLICK, sightspage);
function sightspage(evt:MouseEvent):void 
{

    pageLoader.load(sights);
    stage.addChild(pageLoader);
    
    if(sights.contains(myBanner))
        {
        sights.removeChild(myBanner);
        }
}

```

yet i still get the error  
1061: Call to a possibly undefined method contains through a reference with static type [flash.net](http://flash.net):URLRequest.

is my syntax correct, punctuation, braces, parentheses etc all in the right places?

thanks for the help!!!

lisa  
:nerd:
