Get Slideshow to move with slider

Hello,
i’m trying to get my slideshow moves as i move the slider
so when moving to slider 2 , slide 2 appears
slider 3 with slide 3
and so on
i tried different coding i’m not really an expert
but nothing worked
this is my last trial , still not working

export function slider1_onChange(event) {
 let newValue = event.target.value;  // "new value"

 if (event.target.value === 1) {
 $w('#slideshow1').changeSlide('#slideshowSlide1');
        }
 else if (event.target.value === 2) {
 $w('#slideshow1').changeSlide('#slideshowSlide2');
        }
 else if (event.target.value === 3) {
 $w('#slideshow1').changeSlide('#slideshowSlide3');
        }
 else if (event.target.value === 4) {
 $w('#slideshow1').changeSlide('#slideshowSlide4');
 }}

any help ?

thanks in advance

First of all, I’ll assume that you closed the main function but just didn’t paste it.
Second, try adding quotation mark:

if(event.target.value === "1")

and for all the others.

no, I don’t know how as I keep on receiving unexpected token )

export function slider1_onChange(event) {
 let newValue = event.target.value;  // "new value"
});

@er-emey what’s the purpose of this line if you don’t use it later?

 let newValue = event.target.value;  // "new value"

Have you tried to use a string instead of number ?

@jonatandor35 :sweat_smile:not an expert , i tried my best and this is what I’ve got .
also ,i’m not sure what string is :roll_eyes::see_no_evil:

@er-emey string is like text (as opposed to number).
It means that instead of writing the number 1 , use “1” in quotation marks (i.e. the character “1” and not the number it represents).
And do so for all the other values you retrieve from the slider on change.