/    Sign up×
Community /Pin to ProfileBookmark

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.

to post a comment

5 Comments(s)

Copy linkTweet thisAlerts:
@Eye_for_VideoJan 05.2009 — 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.[/QUOTE]
looks like you have no opening brace ({) for this starement
[CODE]line 196: }// end try[/CODE]
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;[/CODE]
and before
[CODE]line 195: switch[/CODE]
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
Copy linkTweet thisAlerts:
@JerrellauthorJan 06.2009 — 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;
}
Copy linkTweet thisAlerts:
@Eye_for_VideoJan 06.2009 — 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[/QUOTE]

Maybe with a fuller view you can better interpret these errors

EfV
Copy linkTweet thisAlerts:
@JerrellauthorJan 06.2009 — 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;
}
Copy linkTweet thisAlerts:
@Eye_for_VideoJan 06.2009 — 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
×

Success!

Help @Jerrell spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...