Hi there, this is my first post so be gentle...



I'm working on a simple presentation website in flash that imports swf-banners onto the main page. This works, but I need a backgroundcolor and a border so the banners aren't seethrough. So I create another graphic element that puts itself underneath. All this works, but when I try to write a button to remove the "child" it only removes the imported swf (loader) but it can't remove the box underneath - even if I remove the loader-child completely.



I get a "1120: Access of undefined property Kant." error



CODE for buttons & loading the swf:

Code:
stop();
var Xpos:Number=10;
var Ypos:Number=230;
var swf:MovieClip;
var loader:Loader = new Loader();

 

// Btns Universal function
function btnClick(event:MouseEvent):void {
MovieClip(root).Clean_mc.gotoAndPlay(2)

var SWFRequest:URLRequest=new URLRequest(event.target.name+".swf");

 

//mask

    var rect:Shape = new Shape();
    rect.graphics.beginFill(0xFFFFFF);
    rect.graphics.drawRect(10, 230, 930, 180);
    rect.graphics.endFill();

 

//background and border

    var Kant:Shape = new Shape();
    Kant.graphics.lineStyle(2,0xFFFFFF);
    Kant.graphics.beginFill(0x000000);
    Kant.graphics.drawRect(10, 230, 930, 180);
    Kant.graphics.endFill();

 

//swf loader
    loader.load(SWFRequest);
    loader.x=Xpos;
    loader.y=Ypos;
    //loader.background = true;
        //loader.backgroundColor = 0xFFFFFF;
    loader.mask=rect;

 

    addChild(Kant);
    addChild(loader);
}

 

H3K.addEventListener(MouseEvent.CLICK, btnClick);
AAOO.addEventListener(MouseEvent.CLICK, btnClick);
Metro.addEventListener(MouseEvent.CLICK, btnClick);
Jonas.addEventListener(MouseEvent.CLICK, btnClick);
CS.addEventListener(MouseEvent.CLICK, btnClick);
BEP.addEventListener(MouseEvent.CLICK, btnClick);
WSGM.addEventListener(MouseEvent.CLICK, btnClick);


Code for "resetting" page:


Code:
removeChild(Kant);
removeChild(loader);


It's probably very simple, but I can't get it to work. Please help me fix it, so I can go home early...