Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 如何检查彩信连接是否处于活动状态?_Actionscript 3_Flash Cc - Fatal编程技术网

Actionscript 3 如何检查彩信连接是否处于活动状态?

Actionscript 3 如何检查彩信连接是否处于活动状态?,actionscript-3,flash-cc,Actionscript 3,Flash Cc,我正在检查一些彩信链接是否存在或已断开。我尝试使用netconnection,但它不起作用,我得到了错误 编辑: 以下是我尝试的代码: // Inside function ShowCheckConnectionPopup(); if (connection_combobox.selectedIndex == 0) { urlLoader.load(new URLRequest("http://" + addressStr)); } else i

我正在检查一些彩信链接是否存在或已断开。我尝试使用netconnection,但它不起作用,我得到了错误

编辑: 以下是我尝试的代码:

    // Inside function
    ShowCheckConnectionPopup();

    if (connection_combobox.selectedIndex == 0) {
        urlLoader.load(new URLRequest("http://" + addressStr));
    } else if (connection_combobox.selectedIndex == 1) {
        rtmpVurl = "rtmp://" + rtmpVurl;
        rtmp_test = new RTMP_test();
        addChild(rtmp_test);
        rtmp_test.init(rtmpSid, rtmpVurl);
        rtmp_test.addEventListener(CustomEvent2.PASS_PARAMS, onTestProcessed);
        /*
        rtmp_player.vid.x = 100;
        rtmp_player.vid.y = 100;
        */
    } else if (connection_combobox.selectedIndex == 2) {
        addressStr = "mms://" + addressStr;
        createRtmpConnection(addressStr);
    }
}

var _ncConnection:NetConnection = new NetConnection();
// create a new net connection, add event listener and connect
// to null because we don’t have a media server
_ncConnection = new NetConnection();
_ncConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
_ncConnection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_ncConnection.addEventListener(IOErrorEvent.IO_ERROR,errorHandler);
_ncConnection.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
// _ncConnection.addEventListener(AsyncErrorEvent.ASYNC_ERROR,metaHandler);

function createRtmpConnection(s:String) {
    rtmpTimeoutTimer.reset();
    rtmpTimeoutTimer.start();
    _ncConnection.connect(s);
}
ArgumentError:错误#2004:其中一个参数无效。在 flash.net::NetConnection/connect()位于 Untitled_02_02_fla::MainTimeline/createRtmpConnection()[Untitled_02_02_fla.MainTimeline::frame1:741] 在 未命名的佛罗里达州:MainTimeline/onPopupOkBtnClick()[未命名的佛罗里达州:MainTimeline::frame1:568]*

第741行:\ n连接。连接

第568行:createRtmpConnection(addressStr)


发布您尝试的代码以及您提到的错误。您好,谢谢您的回答。我编辑了这个问题。
addressStr
定义在哪里?我发布了该函数的一部分。我在这里发布了完整的函数:可能
地址。text
不是有效值。