1084 errors

Hey guys,
I am getting a couple 1084 errors I can’t figure out:

THE CODE:
//listener for the ProgressEvent when a download of the new
version is in progress
function onDownloadProgress(eventProgressEvent):void {
windowContent.bar.setProgress(event.bytesLoaded, event.bytesTotal);
}

THE ERROR:
1084: Syntax error: expecting identifier before in.

**
THE CODE:**
//create a window using NativeWindow, and as a content myWindow
class
function createWindow():void {
if (window == null) {
var options:NativeWindowInitOptions = new NativeWindowInitOptions();
options.systemChrome = NativeWindowSystemChrome.STANDARD;
options.type = NativeWindowType.NORMAL;

    window = new NativeWindow(options);
    window.x = 300;
    window.y = 200;
    window.stage.stageHeight = 230;
    window.stage.stageWidth = 450;
    window.stage.scaleMode = StageScaleMode.NO_SCALE;
    window.stage.align = StageAlign.TOP_LEFT;
    window.stage.addChild(windowContent);
    windowContent.bar.visible = false;
}
window.alwaysInFront = true;
window.visible = true;

}

THE ERRORS:
1084: Syntax error: expecting identifier before function.
1084: Syntax error: expecting leftbrace before leftparen.

I can’t for the life of me figure it out. Whats wrong with my code?