Stupid syntax!

i got this error


Scene=Scene 1, Layer=Layer 1, Frame=1: Line 6: ';' expected
     		percentLoaded=Math.round((_root.getBytesLoaded)))

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 7: ';' expected
     		/(_root.getBytesTotal()) * 100)

when i put this code in


onClipEvent (enterFrame) {
	if (_root.getBytesLoaded() == _root.getBytesTotal()) {
		gotoAndStop(2);
	} else {
		_root.stop()
		percentLoaded=Math.round((_root.getBytesLoaded)))
		/(_root.getBytesTotal()) * 100)
		loadedFile = "File is" + percentLoaded + "% loaded"
}

help would be greatly appreciated

Well, as the error msg tries to tell you , just add the " ; " at the end of your actions in the else statement: after stop();
after *100);
after loaded";

and it should be ok

code looks like this now … with the ; added at the ends of lines 5,6 and 7


onClipEvent (enterFrame) {
	if (_root.getBytesLoaded() == _root.getBytesTotal()) {
		gotoAndStop(2);
	} else {
		_root.stop();
		percentLoaded=Math.round((_root.getBytesLoaded)));
		/(_root.getBytesTotal()) * 100);
		loadedFile = "File is" + percentLoaded + "% loaded"
}

still returns the same error

not:

} else {
		_root.stop();
		percentLoaded=Math.round((_root.getBytesLoaded)));
		/(_root.getBytesTotal()) * 100);
		loadedFile = "File is" + percentLoaded + "% loaded"
}

but:

} else {
		_root.stop();
		percentLoaded=Math.round((_root.getBytesLoaded()) //not here
		/(_root.getBytesTotal()) * 100);
		loadedFile = "File is" + percentLoaded + "% loaded"; //add here
}

coz the percentLoaded stuff goes over 2 lines, it’s loaded divided by total , result x 100, then ; for end of command

makes sense
did what you said
returns exactly the same error.:-\

sorry for the double post … i posted it here … and then thought the AC forum would be a better place :slight_smile:

check beeners reply over there too, no line break, all on one line, and also recheck your pairs of opening ( versus closing) , i think there’s one too many & one missing, that should do it.