HTML5 better code size reduction

“Uncaught TypeError: Cannot read property ‘tx’ of undefined”

it refers to DisplayObject.hx, function

private function set_x (value:Float):Float {
	if (value != __transform.tx) __setTransformDirty (); XXX
	return __transform.tx = value;
}

I also see "NaN where I previously saw integers, and the application hangs.

EDIT: By adding "@:keepSub " in DisplayObject class the error changed to a similar one, but on another class

“Uncaught TypeError: customGameService.getBalance is not a function”

I think I have to put "@:keep/@:keepSub " in other classes, but how can I easily identify which ones?

You could try using Chrome’s builtin debugger, which can pause on uncaught exceptions.

In my case, errors were mostly caused because I tried to instantiate a class with reflection. As doc says, DCE cannot detect classes/methods used through dynamic and reflections.

I am using Chrome, but it is not easy at all, I have to infer where the problem is by trying and guess. Yes, I think Dynamic is the culprit in most cases, I will try again.