-
getting a button's instance name in on(release)
Just wondering if anybody know if there is a way of getting the button's instance name that was clicked inside the button's on(release) function. Similar to UI button where the component is pass to the event handler function, so you know what UI button was clicked. I can convert the button to a movie clip and use this._name to get the instance name, but just want to know if there is a similar way to do it with a button.
-
That should work with a button now, too (in MX) ... stands to reason if you can name an instance of a button now you should be able to retrieve it's name using the _name property.
----------
"Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT
-
Senior Member
Yep , works just gave it a shot.
btnName.onRelease = function() {
trace(this._name);
//btnName
};
-
cool, it works, thanks guys. I was trying to do with in on(release) function attached to the actually button, when I use this._name within that function, it just gave me level0, instead of the button name. If I do it you guys' way by using btnName.onRelease, this._name actually give you the name of the button.
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
|