I would definitely recommend reading the docs I linked to in my other
post but since I know seeing progress is always helpful here is a
quick block of pseudo code for what you're talking about. Creating
menus/buttons from XML, ah nostalgia. :)
for each( var node:XML in menuXML.children() )
{
var btn:Button = new Button();
btn.label = [EMAIL PROTECTED];
btn.addEventListener( MouseEvent.CLICK, handleClick );
menuContainer.addChild( btn );
}
...
private function handleClick( event:MouseEvent ):void
{
trace( Button( event.target ).label + " was clicked" );
}
HTH,
Ben
--- In [email protected], "Jason The Saj" <[EMAIL PROTECTED]> wrote:
>
> I guess my difficulty is that my goal is to load the buttons
> dynamically based upon an XML config file for which buttons should be
> existent.
>
> So I need to be able to dynamically create these event listeners. I am
> sure there is a good way to do this. I really wish Adobe would do some
> cross-training documentation.
>
> (ie: In AS1/AS2 you might have done this....in AS3 you're going to
> want to do this and break it out into these chunks).
>
> I think such a thing would be very useful for many people.
>
> - Jason
>