Slide screen preloader

hello,

I have a seperate swf for my pre loader.
It’s just a text layer and an actions layer with this in the first frame.
(I am using the slide screen presentation template)

var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS. loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE. done);
l.load(new URLRequest("Presentation1.swf"));

function loop(e:ProgressEvent):void
{
    var perc:Number = e.bytesLoaded / e.bytesTotal;
    percent.text = Math.ceil(perc*100).toString();

function done(e:Event):void
{
    removeChildAt(0);
    percent = null;
    addChild(l);
}

It gives me this error

1084: Syntax error: expecting rightbrace before end of program.

If you need more info let me know.
And I really hope you can help