# Component Event Script- How to change property of source or another component

**URL:** <https://forum.inductiveautomation.com/t/component-event-script-how-to-change-property-of-source-or-another-component/34964>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [May 22, 2020, 2:00am UTC](https://forum.inductiveautomation.com/t/component-event-script-how-to-change-property-of-source-or-another-component/34964 "2020-05-22T02:00:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![newbie](https://avatars.discourse-cdn.com/v4/letter/n/dc4da7/32.png) [@newbie](https://forum.inductiveautomation.com/u/newbie)\
**Post date:** [May 22, 2020, 2:00am UTC](https://forum.inductiveautomation.com/t/component-event-script-how-to-change-property-of-source-or-another-component/34964/1 "2020-05-22T02:00:38Z")

</div>

I have a button which when pressed runs whole bunch of HTTP POST and GET protocols which takes few seconds to run the whole event script. To make it more inuitive and to show button was actually pressed and script is running in background, how do I change the property of the source or any other component on the window? I tried changing text of source and even multi state indicator trying to make it change state based on what the Button event script is running but nothing gets updated till the script is done.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [May 22, 2020, 5:35am UTC](https://forum.inductiveautomation.com/t/component-event-script-how-to-change-property-of-source-or-another-component/34964/2 "2020-05-22T05:35:16Z")

</div>

> [@Update progress bar from within a script](http://forum.inductiveautomation.com/t/update-progress-bar-from-within-a-script/21995/3):
>
> Event scripts run in the foreground. Painting the UI runs in the foreground, so it can’t happen until your script finishes. You need to wrap up your long-running operation into a function, and then run that with invokeAsynchronous. That function can send updates back to the foreground with invokeLater. You must not ever assign to component properties or call component methods from an asynchronous (background) function. You can really scramble Swing and/or deadlock it. Take a look at this t…
