我不能刪除rute_button的事件,rute_button.removeEventlistener不起作用。 函數tampil_rute(t)有什麼問題嗎?謝謝..Can not removeEventlistener
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;
}
哪裏的rute_button被定義? – Jono
上功能tampil(t) – dikagaulzzz