Actionscript 3 - checking for an internet connection

前端 未结 3 1036
隐瞒了意图╮
隐瞒了意图╮ 2020-12-20 23:44

I am using this code in my flash file

import air.net.URLMonitor;
import flash.net.URLRequest;
import flash.events.StatusEvent;

var monitor:URLMonitor;

func         


        
3条回答
  •  没有蜡笔的小新
    2020-12-21 00:42

    The air.net.URLMonitor is the AIR available class - so will not work outside of the AIR player.

    But you could try to do your own as all this monitor class does is "ping" the url and check the response, so you could do similar try to load something from known source like google.com and if it completes wihtout error then it is OK otherwise you will get error.

提交回复
热议问题