спасибо!
теперь такое, не понимаю, в чем дело
создал приложение AIR 2.0
в main
Код AS3:
var _server:ServerConnect = new ServerConnect();
в классе ServerConnect
Код AS3:
package server
{
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.net.DatagramSocket;
import flash.net.ServerSocket;
import flash.net.Socket;
import flash.data.SQLConnection;
import flash.events.ServerSocketConnectEvent;
import flash.display.Sprite;
public class ServerConnect extends Sprite
{
//Сервер
private var serverSocket:ServerSocket;
//Массив клиентов
private var clients:Vector; //строка 23
//конструктор
public function ServerConnect()
{
serverSocket = new ServerSocket();
clients = new Vector();
serverSocket.addEventListener(ServerSocketConnectEvent.CONNECT, onConnect);
trace('wtf');
}
private function onConnect(event:ServerSocketConnectEvent ):void
{
var clientSocket:Socket = event.socket;
clientSocket.addEventListener( ProgressEvent.SOCKET_DATA, onClientSocketData);
clients.push(clientSocket);
trace(clientSocket.remoteAddress + ":" + clientSocket.remotePort);
}
private function onClientSocketData( event:ProgressEvent ):void
{
trace((event.target as Socket).readObject());
}
public function bind():void
{
if( serverSocket.bound )
{
serverSocket.close();
serverSocket = new ServerSocket();
}
serverSocket.bind( 2222, "192.168.1.100"); //слушаем порт 2222
serverSocket.listen();
}
private function send( text:String ):void
{
for(var i:int;i<clients.length;i++)
{
if( clients[i] != null )
{
clients[i].writeUTF( text );
clients[i].flush();
}
}
}
}
}
выдает:
Цитата:
Попытка запуска и подключения к Flash Player по URL-адресу C:/Program Files/Adobe/projects/mainAIR-app.xml
[SWF] mainAIR.swf - 3670 байт после декомпрессии
TypeError: Error #1007: Instantiation attempted on a non-constructor.
at server::ServerConnect()[C:\Program Files\Adobe\projects\server\ServerConnect.as:23]
at ServerConnect()
at mainAIR_fla::MainTimeline/frame1()[mainAIR_fla.MainTimeline::frame1:1]
at runtime::ContentPlayer/loadInitialContent()
at runtime::ContentPlayer/playRawContent()
at runtime::ContentPlayer/playContent()
at runtime::AppRunner/run()
at global/runtime::ADLEntry()
Сеанс отладки прерван.
|
Инстанцирование покушение на не-конструктор - ?
вот появившийся xml
Код:
<?xml version ="1.0" encoding="utf-8" ?><application xmlns="http://ns.adobe.com/air/application/2.0"><id>mainAIR</id><version>1.0</version><filename>mainAIR</filename><description></description><!-- To localize the description, use the following format for the description element.<description><text xml:lang="en">English App description goes here</text><text xml:lang="fr">French App description goes here</text><text xml:lang="ja">Japanese App description goes here</text></description>--><name>mainAIR</name><!-- To localize the name, use the following format for the name element.<name><text xml:lang="en">English App name goes here</text><text xml:lang="fr">French App name goes here</text><text xml:lang="ja">Japanese App name goes here</text></name>--><copyright></copyright><initialWindow><content>mainAIR.swf</content><systemChrome>standard</systemChrome><transparent>false</transparent><visible>true</visible><fullScreen>false</fullScreen><aspectRatio>portrait</aspectRatio><renderMode>auto</renderMode></initialWindow><icon></icon><customUpdateUI>false</customUpdateUI><allowBrowserInvocation>false</allowBrowserInvocation></application>
помогите пожалуйста исправить!