您好,我正在尝试在 Flash 中打开套接字。所以我遵循了一个教程,但出现了错误:
package com.game.game
{
import flash.net.socket;
import flash.events.*;
public dynamic class game
{
var mysocket:Socket = new Socket();
Security.allowDomain("*");
mysocket.addEventListener(Event.CONNECT, onConnect);
mysocket.addEventListener(Event.CLOSE, onClose);
mysocket.addEventListener(IOErrorEvent.IO_ERROR, onError);
mysocket.addEventListener(ProgressEvent.SOCKET_DATA, onResponse);
mysocket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecError);
mysocket.connect("hejp.co.uk", 80);
}
}
我收到了这些错误:
1120: Access of undefined property mysocket.
1120: Access of undefined property onConnect.
1120: Access of undefined property mysocket.
1120: Access of undefined property onClose.
1120: Access of undefined property mysocket.
1120: Access of undefined property onError.
1120: Access of undefined property mysocket.
1120: Access of undefined property onResponse.
1120: Access of undefined property mysocket.
1120: Access of undefined property onSecError.
1120: Access of undefined property mysocket.
The class 'com.game.game.game' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
我必须进口一些东西吗???有任何想法吗 ?