ForumsProgramming Forumhelp with as3

2 3430
ever388
offline
ever388
17 posts
Nomad

i just upgraded to flash cs5 as3 and i didnt realise how diferent it was to as2. how do i create a button that when clicked loads another symbol.

  • 2 Replies
ExplosionsHurt
offline
ExplosionsHurt
248 posts
Nomad

It should look something like this:

<BUTTON INSTANCE NAME HERE>.addEventListener( MouseEvent.CLICK,loadSymbol )

function loadSymbol( evt:MouseEvent )
{
addChild( <SYMBOL CLASS NAME HERE> )
}

In AS3, "Event Listeners" are used instead of the on() statement.

ever388
offline
ever388
17 posts
Nomad

thank you

Showing 1-2 of 2