-
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(eventrogressEvent):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?
-
Should be:
function onDownloadProgress(event:ProgressEvent):void {
windowContent.bar.setProgress(event.bytesLoaded, event.bytesTotal);
}
1084 errors are syntax errors when you forget parenthesis etc. You need to go through your code step by step.
-
Hey thanks a lot for the reply.
I cleaned it up but its still giving me errors.
The specific line is this one:
//listener for the ProgressEvent when a download of the new
version is in progress -This is the specific line its referencing
function onDownloadProgress(event:ProgressEvent):void {
windowContent.bar.setProgress(event.bytesLoaded, event.bytesTotal);
}
1084: Syntax error: expecting identifier before in.
I have rewritten it over and over and it continues to give me the same error what gives?
-
If that is your actual code, including line break, then the problem is that you have what should be in a comment as code.
Use [code] or [php] tags to format code here so we don't have to guess about what you actually have.
Try either moving the complete comment to a single commented line, or making it a multiline comment.
Code:
/*
listener for the ProgressEvent when a download of the new
version is in progress -This is the specific line its referencing
*/
function onDownloadProgress(event:ProgressEvent):void {
windowContent.bar.setProgress(event.bytesLoaded, event.bytesTotal);
}
-
5Tons you have no idea how much you have just helped me.
So I was copying the Actionscript from this tutorial and the code though it looked identical was actually being interpreted by Flash as a function and not commented out code. I fixed the comments and it looks perfect.