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


#1

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)
}


#2

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


#3

yep it was already a button
any help?


#4

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!


#5

Thanks for the help!