How do I make buttons change when I hover over them?

this is the code please explain any errors in the script on my button i am trying to create a game with an interactable button you hover over it and its supposed to say click me here is my code now

function mouseHover() {
this.setText(‘Click Me!’)
}

function mousePressed() {
gotoAndStop(6)
}

so i was going around my file that im working on and im wondering if my button is even set as a button XD

yep it was already a button
any help?

Hi there @EmeraldStar123!

Here’s a nice example file that shows an easy way to make your button:

ButtonExample.wick (2.8 KB)

Instead of using setText, I’ve actually just added an “over” frame to the button by clicking “edit frames”…

…and adding a frame right here:

29%20PM

On this frame, there is some text:

Now, when you hover over the button, it will show that frame. You can change more than text too - in the file I posted, the button also changes color!

Thanks for the help!