Slider value

Hi, I’m pretty new to this. I followed the first tutorial (https://www.fusetools.com/developers/guides/tutorial) and now I am wondering how to retrieve the value of a slider element. This is what I currently have:

        var Observable = require("FuseJS/Observable");
        var buttontext = Observable("Buttonz");
        var amountOfExperience = 0;
        experience = Observable(amountOfExperience);
        var clickcount = 0;

        function click() {
            buttontext.value = "Clicks: " + amountOfExperience;
        }

        module.exports = {
            buttontext : buttontext,
            click : click
        }
    </JavaScript>
    <StatusBarBackground DockPanel.Dock="Top" />
    <ScrollViewer ClipToBounds="true">
        <StackPanel>
            <Slider Value="{experience}" Minimum="0" Maximum="100" />
            <Button Text="{buttontext}" Clicked="{click}"/>
            <Switch Alignment="Left" />
        </StackPanel>
    </ScrollViewer>
</DockPanel>

But, amountOfExperience is always 0… Can anyone please give me a tip in the right direction?

Hi!

Try this:

var experience = Observable(0);
var buttontext = Observable(function() { return "Clicks " + experience.value; });

And this is your module.exports:

module.exports = {
  buttontext : buttontext,
  experience : experience,
  click : click
}