Copy link to clipboard
Copied
var myIcons = new Array();
myIcons[0] = "/path...to/image1.png";
myIcons[1] = "/path...to/image2.png";
var myPanel;
myPanel = myCreatePanel();
myPanel.show();
myIncrement=1;
for(var myCounter = 0; myCounter < 11; myCounter ++){
$.sleep (100);
}
myPanel.hide();
exit();
function myCreatePanel(){
myPanel = new Window('palette', 'test bed');
with(myPanel){
myPanel.myButton = add('image', undefined, myIcons[0]);
myPanel.myButton.addEventListener('click', updateIcon);
}
return myPanel;
}
function updateIcon() {
iconShow +=1; if (iconShow = 2){iconShow = 0};
myPanel.myButton.image = myIcons[iconShow];
}
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Did you ever come up with a solution for this? Thanks!
Copy link to clipboard
Copied
I was having to do this and ended up using the remove() method on my image's parent to remove it, and then add a new image with a different file. Then I called the window.layout.layout(true) to force an update on the window that shows the new added image.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now