我无法删除 rute_button 的事件,rute_button.removeEventlistener 不起作用。函数 tampil_rute(t) 有什么问题吗?谢谢..
function tampil(t)
{
rute_button.addEventListener(MouseEvent.CLICK, tampil_rute(t));
//tampil_rute(t);
var _loadertampil:URLLoader = new URLLoader();
var _datatampil:XML = new XML();
_loadertampil.addEventListener(Event.COMPLETE, readXMLtampil);
_loadertampil.load(new URLRequest("http://localhost/mall_baru/tampil2.php?id="+t));
function readXMLtampil(evttampil:Event)
{
_datatampil = new XML(evttampil.target.data);
var tampilanx = _datatampil..tenant_name;
tampilan.text = String(tampilanx);
trace("tampilan ="+tampilanx);
}
}
function tampil_rute(t)
{
return function( f:MouseEvent )
{
var c = t.split("_", 2);
var d:String = String(c[0]);
var e:Number = Number(c[1]);
for(var i:Number=1; i<=e; i++)
{
tambahan_tampil_rute(d,i);
}
rute_button.removeEventListener(MouseEvent.CLICK, tampil_rute(t));
}
}
function tambahan_tampil_rute(d, i)
{
this["rute_"+d+"_"+i].visible=true;
}