changeSlide not working

when write the code manually it didn’t work. when write with the event handler it worked. thank you