如何完全删除课程?

时间:2015-04-26 17:08:03

标签: actionscript-3 flash-cc

我有一个包含一些网络流和连接的类文件,我试图完全删除该类。这是我的代码:

function onTestProcessed(e:CustomEvent2):void {
    // Remove
    rtmp_test.removeEventListener(CustomEvent2.PASS_PARAMS, onTestProcessed);
    e.currentTarget.parent.removeChild(e.currentTarget);

    // Validation comparison
    if (e.boo == false) {
        trace("event.boo = ", e.boo);
    } else {
        trace("event.boo = ", e.boo);
    }
}

此代码删除视频但不显示声音。我是否必须在类中找到每个变量并逐个删除它们?

1 个答案:

答案 0 :(得分:0)

似乎这样解决了问题:

function onTestProcessed(e:CustomEvent2):void {
    // Remove
    rtmp_test.removeEventListener(CustomEvent2.PASS_PARAMS, onTestProcessed);
    rtmp_test.netStreamObj.close();
    // rtmp_test.netStreamObj = null;
    rtmp_test.vid.clear();
    e.currentTarget.parent.removeChild(e.currentTarget);

    // Validation comparison
    if (e.boo == false) {
        trace("event.boo = ", e.boo);
    } else {
        trace("event.boo = ", e.boo);
    }
}

as3 - How to stop video and detach NetStream