all groups > flash actionscript > august 2005 >
You're in the

flash actionscript

group:

determining what's been pressed



determining what's been pressed canobeans
8/30/2005 11:11:29 PM
flash actionscript: Hey Folks,

So, anybody know if there's a way to determine which button or movie clip has
been pressed from one global script -- without putting a script in every button
and movie clip in the whole project? Seems like there should be some function
I just don't know about like "Object Under Mouse" or something. Anybody?

Thanks,
Mike
Re: determining what's been pressed mandingo
8/30/2005 11:37:36 PM
what version?

MX04 you can create a listener object and add events and register your clips
to the listener object. So basically on click etc, it reports to the listener
object.

in previous versions you could create a similar piece of code through a
function and a loop to create the behaviours for each object then assign a
callBack function to respond depending on the object that was pressed.

cheers
AddThis Social Bookmark Button