The Armor Games website will be down for maintenance on Monday 10/7/2024
starting at 10:00 AM Pacific time. We apologize for the inconvenience.

ForumsProgramming Forumhelp with as3

2 3425
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