Syntax error in javascript on export for all browsers

(theron_hp) #1

Hi. I’m working on quite a complex project and it feels like I am chasing my tail. One of the things I may need to fix is that on export I get this error message for all browsers: “No identifiers allowed directly after numeric literal”.

One of the scripts it refers to as a problem is:(The script’s name is: 1c_2c_3w_4wQuater)

if (hypeDocument.currentTimeInTimelineNamed('3Half_select') == 1) {
	hypeDocument.startTimelineNamed('3Half_select', hypeDocument.kDirectionForward);
	hypeDocument.startTimelineNamed('4Quater_select', hypeDocument.kDirectionForward);
	else { 
			hypeDocument.startTimelineNamed('3Quaver_select', hypeDocument.kDirectionForward);
			hypeDocument.startTimelineNamed('4Quater_select', hypeDocument.kDirectionForward);

Can anyone please assist? I think this may be part of my issue.


(Jonathan Deutsch) #2

It sounds like you have an identifier that begins with a number. Perhaps it is the script name even.

Not allowed:

var 1asdf = 10;


var asdf1 = 10;

From Grammars and Types:


You use variables as symbolic names for values in your application. The names of variables, called identifiers, conform to certain rules.

A JavaScript identifier must start with a letter, underscore (_), or dollar sign ($); subsequent characters can also be digits (0-9). Because JavaScript is case sensitive, letters include the characters “A” through “Z” (uppercase) and the characters “a” through “z” (lowercase).

You can use most of ISO 8859-1 or Unicode letters such as å and ü in identifiers (for more details see this blog post). You can also use the Unicode escape sequences as characters in identifiers.

Some examples of legal names are Number_hits, temp99, $credit, and _name.

(theron_hp) #3

It was the labels od the scripts. It did not want to start with a number. I changed the order of number and letter and now it seems to be happy.

Thanks Jonathan