# Auto trigger button event

**URL:** <https://forum.kirupa.com/t/auto-trigger-button-event/283890>\
**Category:** Uncategorized\
**Created:** [March 12, 2009, 4:42am UTC](https://forum.kirupa.com/t/auto-trigger-button-event/283890 "2009-03-12T04:42:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stii](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@stii](https://forum.kirupa.com/u/stii)\
**Post date:** [March 12, 2009, 4:42am UTC](https://forum.kirupa.com/t/auto-trigger-button-event/283890/1 "2009-03-12T04:42:10Z")

</div>

Hi guys,

i have a question, back in AS2 era,  
if i have an MC on the stage with function as below

[COLOR=“RoyalBlue”][INDENT][INDENT]mc.onRelease = function() {  
trace(“RELEASED”);  
};[/INDENT][/INDENT][/COLOR]

i can actually add in another line

[INDENT][INDENT][COLOR=“RoyalBlue”]mc.onRelease()[/COLOR][/INDENT][/INDENT]

which will trigger my button event without me actually clicking on it.

I was wondering how can i achieve the same effect in as3?

because i am building a website, and i want the 1st button to trigger itself after it is  
created on stage.

any idea guys?  
thanks in advance

regards,  
Edwin
