|
-
Senior Member
one listener, many buttons. Is it possible?
I have many buttons on screen. About 25. They are all different shapes. Is there a way to have a listener that can inform me the _name of the button clicked when any of them is clicked? Thanks ahead for any help.
-
you can do this in actionscript with variable passing. each button thas tis clicked passes itself into a function that gets the button name(providing you give it an instance name) and does whatever you want to do with it.
Code:
myButton_btn.onRelease = function(){
getName(this);
}
function getName(button){
trace(eval(button)._name);
}
Last edited by VI Knight; 08-24-2006 at 06:38 PM.
-
Senior Member
Thanks Knight, I´ll try that, sounds like a great solution!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|