I have to implement a menu with icons using actionscript only.
I create a data provider from XML and set
menu = Menu.createMenu(null, dataArray, true);
menu.iconFunction = iconFunction;
Till here everything is fine and my menu is presented, but only with labels.
I create iconFunction as following:
private function iconFunction(item:Object):Class
{
var st:Loader = new Loader();
st.load(new URLRequest(item.icon));
return ?;
}
and here’s my question: how do I return my loader object as Class?
I’m googling this for hours and cannot find something relevant.
Thanks a lot!
You can use Ben Stucki’s solution as a base.