WHAT'S NEW?
Loading...

function,mc,button with array


 var menu:Array = [mc1,mc2];
var fungsi:Array = [fungsimc1,fungsimc2];
for (var i:int = 0; i < menu.length; i++)
{
menu[i].buttonMode = true;
menu[i].addEventListener(MouseEvent.CLICK, fungsiklik);
}
function fungsiklik(event:MouseEvent):void
{
for (var i:int = 0; i < menu.length; i++)
{
if (event.currentTarget == menu[i])
{
fungsi[i]();
}
}

}
function fungsimc1()
{
trace("mc1");
}
function fungsimc2()
{
trace("mc2");
}