my_btn.onRelease = function(){ target_xml.onLoad = null; target_xml.onload = function(){ trace("new function assigned"); } target_xml.load("loadPath"); }