# Click event for button

**URL:** <https://forum.kirupa.com/t/click-event-for-button/315677>\
**Category:** Uncategorized\
**Created:** [November 1, 2010, 6:15pm UTC](https://forum.kirupa.com/t/click-event-for-button/315677 "2010-11-01T18:15:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![treeleaf20](https://avatars.discourse-cdn.com/v4/letter/t/bb73d2/32.png) [@treeleaf20](https://forum.kirupa.com/u/treeleaf20)\
**Post date:** [November 1, 2010, 6:15pm UTC](https://forum.kirupa.com/t/click-event-for-button/315677/1 "2010-11-01T18:15:27Z")

</div>

All,  
I have a button on my page and when I click it, I’d like a sendAndLoad event to happen. The button’s instance name is button. I’m not sure how to get the sendAndLoad to be activated when the button (in this case a submit button) is pressed. I know that sendAndLoad is with the LoadVars class so I’m not sure it can even be called within a button actions. Any advice is greatly appreciated.

Here is the sendAndLoad I’m trying to use:

```auto

var send_mc:LoadVars = new LoadVars(); 

send_mc.name_field = this.name_field; 
send_mc.memory= this.memory;

send_mc.sendAndLoad("http://localhost/xampp/site/new_memory.php", send_mc, "POST"); 

```

Thanks in advance!
