listeners setting view model changes not working properly
I have a view model called PaletteViewModel that has five instances of multiple color variables. In the GlobalViewModel (assigned to my main artboard) i then have five viewModel properties, each referring to one of the possible instances of PaletteViewModel.
This is the setup:
- The colors of the shapes in my main artboard are connected to some color variables (bgColor, textColor1, …)
- Events toPalette1, toPalette2, …, toPalette5, are fired onEntering their specific timeline in the State Machine
- Listeners listen to these Event and set the color variables equal to the corresponding color of the instance of PaletteViewModel (so if toPalette1 is fired its Listener sets bgColor equal to GlobalViewModel → palette 1 (PaletteViewModel) → bgColor (PaletteViewModel))
It doesn’t work properly though: it works only once. On the first state one of these events is fired everything works, but any other time one of these events should be fired nothing changes.
It seems like firing another event does not override the color variables?
Any idea why this could happen?