# actionPerformed to created button from the scrip

**URL:** <https://forum.inductiveautomation.com/t/actionperformed-to-created-button-from-the-scrip/15802>\
**Category:** General Discussion\
**Created:** [October 28, 2017, 4:14pm UTC](https://forum.inductiveautomation.com/t/actionperformed-to-created-button-from-the-scrip/15802 "2017-10-28T16:14:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![antoniosantos\_ccb](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@antoniosantos\_ccb](https://forum.inductiveautomation.com/u/antoniosantos_ccb)\
**Post date:** [October 28, 2017, 4:14pm UTC](https://forum.inductiveautomation.com/t/actionperformed-to-created-button-from-the-scrip/15802/1 "2017-10-28T16:14:30Z")

</div>

I need to add an actionPerformed/event for my button created on script

```auto
import com.inductiveautomation.factorypmi.application.components as obj 

comp = obj.PMIButton()
comp.setName(name)
comp.visible = True
root.addComponent(comp)
system.gui.moveComponent(comp, x-XValue,y)

```

I need to add an actionPerformed on the scrip.  
How?
