Search code examples
buttonlivelivecode

How do I change the icon of a button in livecode, using code and not the inspector tool?


I want to have a button change appearance when certain events occur. I thought the code would look something like this:

on mouseUp
   set the icon of this button to the id 1044
end mouseUp

The icon of the button is its normal appearance and in inspector when you put the id of a certain image into the icon space the image will take on the appearance of whatever has that icon. What code would allow me to do this


Solution

  • set the icon of button "abc" to 1044
    

    or

    set the icon of button "abc" to the id of image "source image"
    

    In both cases you are setting the icon property of the button to the id of an image object.