www.webdeveloper.com
Results 1 to 6 of 6

Thread: 1084: Syntax error: expecting identifier before right

  1. #1
    Join Date
    Jan 2009
    Posts
    6

    Angry 1084: Syntax error: expecting identifier before right

    Any help / suggestions are appreciated.

    Problem.

    My client has sent me .swf files that are to be redone ... the problem is the original developer did not leave the .fla file so I am using a flash decompiler (*******)... I'm getting a bunch of funk code...

    I am receiving one of several error messages... hope the first error will fix the others...

    here is the error message(1):

    CustomVideoPlayer.as, Line 196 1084: Syntax error: expecting identifier before rightbrace.

    here is the action script:

    line 194: var _loc_3:* = event.info.code;
    line 195: switch(_loc_3 === "NetStream.Buffer.Full" ? (1) : (_loc_3 === "NetStream.Play.Start" ? (2) : (_loc_3 === "NetStream.Play.StreamNotFound" ? (3) : (_loc_3 === "NetStream.Play.Stop" ? (4) : (_loc_3 === "NetStream.Seek.Notify" ? (5) : (Jump to 23)
    line 196: }// end try

    I have been working on solving this problem all day with no solution... but great suggestions from developers.

    I have changed the above statement from a "switch" to a "if" statement ... not too familiar with (Jump to ...) so I removed it because it just did not look correct ... and removed the colons to semi-colons ... but I am still receiving the same error message
    "Re: 1084: Syntax error: expecting identifier before rightbrace."

    I can post or email the project files if that will help.

  2. #2
    Join Date
    Feb 2008
    Location
    NW Washington State
    Posts
    1,856
    Remember that decompliers do their best to guess at the code but it may not be the exact stuff. So here's a guess..
    Line 196 1084: Syntax error: expecting identifier before rightbrace.
    looks like you have no opening brace ({) for this starement
    Code:
    line 196: }// end try
    If I was guessing...which I am by the way, I'd put it in after:
    Code:
    line 194: var _loc_3:* = event.info.code;
    and before
    Code:
    line 195: switch
    but that really doesn't make sense unless it's also enclosed in a larger statement. Do you have an opening brace ({) for this statement?
    EfV

  3. #3
    Join Date
    Jan 2009
    Posts
    6

    1084: Syntax error: expecting rightparen before colon.

    Thanks For The Advance... I made some changes .. now I am only receiving one error ...

    Error Message :

    1084: Syntax error: expecting rightparen before colon.

    New Code:

    private function netStatusHandler(event:NetStatusEvent):void {

    var event:* = param1;

    try
    {
    switch (_loc_3:event.info.code){
    case "NetConnection.Connect.Success" :
    break;
    case "NetStream.Play.Start" :
    netStatusEvt=new CustomVideoPlayer(CustomVideoPlayer.START,true,false,event.info.code);
    dispatchEvent(netStatusEvt);
    break;
    case "NetStream.Play.Stop" :
    netStatusEvt=new CustomVideoPlayer(CustomVideoPlayer.PLAY_STOP,true,false,event.info.code);
    dispatchEvent(netStatusEvt);
    break;
    case "NetStream.Buffer.Full" :
    netStatusEvt=new CustomVideoPlayer(CustomVideoPlayer.BUFFER_FULL,true,false,event.info.code);
    dispatchEvent(netStatusEvt);
    break;
    case "NetStream.Buffer.Flush" :
    netStatusEvt=new CustomVideoPlayer(CustomVideoPlayer.BUFFER_FLUSH,true,false,event.info.code);
    dispatchEvent(netStatusEvt);
    break;
    case "NetStream.Buffer.Empty" :
    netStatusEvt=new CustomVideoPlayer(CustomVideoPlayer.BUFFER_EMPTY,true,false,event.info.code);
    dispatchEvent(netStatusEvt);
    break;
    case "NetStream.Seek.Notify" :
    netStatusEvt=new CustomVideoPlayer(CustomVideoPlayer.SEEK,true,false,event.info.code);
    dispatchEvent(netStatusEvt);
    break;
    case "NetStream.Play.StreamNotFound" :
    case "NetStream.Publish.BadName" :
    case "NetConnection.Connect.Closed" :
    case "NetConnection.Connect.Failed" :
    case "NetStream.Play.Failed" :
    netStatusEvt=new CustomVideoPlayer(CustomVideoPlayer.CONNECTION__ERROR,true,false,event.info.code);
    dispatchEvent(netStatusEvt);
    break;
    }
    } catch (error:TypeError) {
    // Ignore any errors. Errors suck
    }
    return;
    }
    Last edited by Jerrell; 01-05-2009 at 06:58 PM. Reason: code was not shown

  4. #4
    Join Date
    Feb 2008
    Location
    NW Washington State
    Posts
    1,856
    I just can't spot any syntax error.
    Well I pasted your code into Flash just to see if it could spot something...it shows up with 5 errors...which I'm not sure how to interpret but here..take a look and see if you see something suspicious.
    **Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 1: Attribute used outside class.
    private function netStatusHandler(event:NetStatusEvent):void {

    **Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 3: A type identifier is expected after the ':'.
    var event:* = param1;

    **Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 7: ')' expected
    switch (_loc_3:event.info.code){

    **Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 8: 'case' statements can only be used inside of a 'switch' statement
    case "NetConnection.Connect.Success" :

    **Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 10: 'case' statements can only be used inside of a 'switch' statement
    case "NetStream.Play.Start" :

    Total ActionScript Errors: 5 Reported Errors: 5
    Maybe with a fuller view you can better interpret these errors
    EfV

  5. #5
    Join Date
    Jan 2009
    Posts
    6

    Unhappy

    I think that line has been resolved ... however I am now receiving a really ugly error message ... any idea what this means?

    TypeError: Error #1007: Instantiation attempted on a non-constructor.
    at VideoPlayer::UtilMethods$/createTextFormat()
    at VideoPlayer/loaderInit()

    here is the updated script:

    private function netStatusHandler(event:NetStatusEvent):void {

    var event:* = param1;

    try
    {
    _loc_3 = event.info.code;
    switch (_loc_3){
    case "NetConnection.Connect.Success" :
    break;
    case "NetStream.Play.Start" :
    netStatusEvt=new CustomVideoPlayer(CustomVideoPlayer.START,true,false,event.info.code);
    dispatchEvent(netStatusEvt);
    break;
    case "NetStream.Play.Stop" :
    netStatusEvt=new CustomVideoPlayer(CustomVideoPlayer.PLAY_STOP,true,false,event.info.code);
    dispatchEvent(netStatusEvt);
    break;
    case "NetStream.Buffer.Full" :
    netStatusEvt=new CustomVideoPlayer(CustomVideoPlayer.BUFFER_FULL,true,false,event.info.code);
    dispatchEvent(netStatusEvt);
    break;
    case "NetStream.Buffer.Flush" :
    netStatusEvt=new CustomVideoPlayer(CustomVideoPlayer.BUFFER_FLUSH,true,false,event.info.code);
    dispatchEvent(netStatusEvt);
    break;
    case "NetStream.Buffer.Empty" :
    netStatusEvt=new CustomVideoPlayer(CustomVideoPlayer.BUFFER_EMPTY,true,false,event.info.code);
    dispatchEvent(netStatusEvt);
    break;
    case "NetStream.Seek.Notify" :
    netStatusEvt=new CustomVideoPlayer(CustomVideoPlayer.SEEK,true,false,event.info.code);
    dispatchEvent(netStatusEvt);
    break;
    case "NetStream.Play.StreamNotFound" :
    case "NetStream.Publish.BadName" :
    case "NetConnection.Connect.Closed" :
    case "NetConnection.Connect.Failed" :
    case "NetStream.Play.Failed" :
    netStatusEvt=new CustomVideoPlayer(CustomVideoPlayer.CONNECTION__ERROR,true,false,event.info.code);
    dispatchEvent(netStatusEvt);
    break;
    }
    } catch (error:TypeError) {
    // Ignore any errors. Errors suck
    }
    return;
    }

  6. #6
    Join Date
    Feb 2008
    Location
    NW Washington State
    Posts
    1,856
    Nope, I don't know what that means. But I did Google it and then are a number of explanations of similar problems on other Forums, etc.
    EfV

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles