Skip to main content
Inspiring
November 17, 2006
Question

variable = name of instance i just clicked

  • November 17, 2006
  • 1 reply
  • 157 views
On main stage I have 4 buttons each with different instance name (but1, but2, but3, but4).

On main timeline I want to create a variable whose value is equal to the instance name of the button I've just clicked. How do I do this?

Thanks,
Jamie
This topic has been closed for replies.

1 reply

Inspiring
November 17, 2006
but1.onRelease = function () {
_root.buttonClicked = this._name ;
}

or, depending where you put the on release:

on (release) {
_root.buttonClicked = this._name ;
}


"jabresner" <webforumsuser@macromedia.com> wrote in message
news:ejlff7$co3$1@forums.macromedia.com...
> On main stage I have 4 buttons each with different instance name (but1,
> but2,
> but3, but4).
>
> On main timeline I want to create a variable whose value is equal to the
> instance name of the button I've just clicked. How do I do this?
>
> Thanks,
> Jamie
>