Hi, I’m trying to change a Gradient Color based on timer and While conditionals, but it wont work.
It will always take it as False even though debug_log shows the value change from False to True.
Can someone point out what am I doing wrong and how can I fix it?
Thanks in advance.
var Observable = require("FuseJS/Observable");
var Timer = require("FuseJS/Timer");
var isSomethingEnabled = Observable(false);
Timer.create(function() {
debug_log(isSomethingEnabled.value);
isSomethingEnabled = Observable(true);
}, 5000, true);
module.exports = {
Timer: Timer,
isSomethingEnabled: isSomethingEnabled,
Observable: Observable
}
</JavaScript>
<WhileFalse Value="{isSomethingEnabled}">
<Change GradientColor1.Color="#fff" />
</WhileFalse>
<WhileTrue Value="{isSomethingEnabled}">
<Change GradientColor1.Color="Red" />
</WhileTrue>