# Button component instance syntax error

**URL:** <https://forum.kirupa.com/t/button-component-instance-syntax-error/229552>\
**Category:** flash\
**Created:** [June 18, 2007, 3:08pm UTC](https://forum.kirupa.com/t/button-component-instance-syntax-error/229552 "2007-06-18T15:08:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeanmichel](https://avatars.discourse-cdn.com/v4/letter/j/9d8465/32.png) [@jeanmichel](https://forum.kirupa.com/u/jeanmichel)\
**Post date:** [June 18, 2007, 3:08pm UTC](https://forum.kirupa.com/t/button-component-instance-syntax-error/229552/1 "2007-06-18T15:08:50Z")

</div>

I have 3 insances of the button component on stage named 2\_btn, 3\_btn and 4\_btn.

They all are broadcasters and have been initialized.

I want them to broadcast an event and pass a variable along each time they are pressed.

This code is attached to frame of main timeline

```auto

this.2_btn.onRelease = function(){
    broadcastMessage("onBtnPressed", 1); 
}
_root.3_btn.onRelease = function(){
    this.broadcastMessage("onBtnPressed", 2); 
}
4_btn.onRelease = function(){
    this.broadcastMessage("onBtnPressed", 3); 
}

```

Now i’d really like to know why do i get these errors :

```auto

**Error** Scene=Scene 1, layer=actions, frame=1:Line 11: Syntax error.
     this.2_btn.onRelease = function(){

**Error** Scene=Scene 1, layer=actions, frame=1:Line 14: Syntax error.
     _root.3_btn.onRelease = function(){

**Error** Scene=Scene 1, layer=actions, frame=1:Line 17: Syntax error.
     4_btn.onRelease = function(){

```

I use flash 8 and AS2.

thanks for helping out
