new Cesium.Event() for Clock.multiplier only fired once?

I’m trying to add an event listener for the speed multiplier in Clock by using the example from by doing the following:

var evt = new Cesium.Event();
evt.addEventListener(TimeControl.prototype.multiplierListener, this);


This executes my **TimeControl.prototype.multiplierListener **exactly once. I expected to get any change to the clock.multiplier variable, is this correct or have I misunderstood the usage of Cesiums Event handler? Or should it be executed another way to get all changes?

Any help would be appreciated.


You will have to make changes to the code base to support this behavior. The changes need to make changes to the ClockViewModel class.

Add your event to the constructor, then call raiseEvent from the set function here: ClockViewModel.js#L109-L115

That way the event gets triggered whenever the value of multiplier changes. Currently, your event gets raised only once because you’re only calling raiseEvent once.