View Full Version : Change Image when a button is clicked

22 Sep 2011, 7:08 PM
I have an image and a button within a panel.

When the button is clicked I would like my image to be replaced with another image at random based on an array of stored images.

Im stuck on implementing a change image function within the button.

Assistance would be appreciated.

23 Sep 2011, 2:10 AM
Using Ext.Img (http://docs.sencha.com/ext-js/4-0/#!/api/Ext.Img) you can change the source of the image inside the click handler of the button.