First you need to give the pair of gui objects global names (there are other ways to do it but global names are the easiest).
To set the name write it in its place in the gui editor.
http://docs.garagegames.com/torque-3d/o ... ction.html
You can see the global name box in the picture. It says
Let's say you named them 'MyButton' and 'MyBitmap'.
Inside the 'DeSign' function that is called when you click the button you add:
Those functions are from gui in general as you can see in
http://docs.garagegames.com/torque-3d/r ... ntrol.html
Note the format
If it doesn't work be sure to check the console for errors. Some name might be misspelled or a ; could be hanged somewhere. Check all the console for red messages.
Edit: that documentation is a bit old but it works.
For extra help you may want to check http://wiki.torque3d.org/main:documentation
or look at some posts around in this forum.