I:\...\Apitech.as, строка 1 5007: Файл ActionScript должен иметь хотя бы одно внешнее определение.
class Apitech extends Object { static private var _instance:Object; public function Apitech() { _instance = this; } static function get instance():Object { if (!_instance) { return new Apitech(); } return _instance; } private var inited:Boolean = false; private var conn:LocalConnection; private var sendConnName:String; private var recvConnName:String; static private var CONNECTION_PREFIX:String = '_apitech_'; static private var CONNECTION_EXCLUDE:Array = [':', '/', '\\', '.']; static private var SEND_CONN_POSTFIX:String = '_avm2'; static private var RECV_CONN_POSTFIX:String = '_avm1'; private function getConnectionName(game:MovieClip):String { var url:String = game._url; for (var i:Number = 0; i < CONNECTION_EXCLUDE.length; i++) { url = url.split(CONNECTION_EXCLUDE[i]).join(''); } return CONNECTION_PREFIX + url; } static function init(game:MovieClip, name:String):Void { name = name || null; instance._init(game, name); } public function _init(game:MovieClip, name:String):Void { if (!inited) { inited = true; var connName:String = getConnectionName(game); sendConnName = connName + SEND_CONN_POSTFIX; recvConnName = connName + RECV_CONN_POSTFIX; conn = new LocalConnection(); conn.allowDomain = function ():Boolean { return true; }; conn.allowInsecureDomain = function ():Boolean { return true; }; conn.onStatus = function (infoObject:Object):Void { switch (infoObject.level) { case 'status': break; case 'error': case 'warning': default: trace('Apitech connection ' + infoObject.level); } }; conn.connect( recvConnName ); conn.showNewGame = conn_showNewGame; conn.send( sendConnName, 'init', name ); } } static public function sendScores(score:Number):Void { instance._sendScores(score); } public function _sendScores(score:Number):Void { if (inited) { conn.send( sendConnName, 'sendScores', score); } } static public function showPopup(x:Number, y:Number, newGame:Object):Void { x = x || NaN; y = y || NaN; newGame = newGame || null; instance._showPopup(x, y, newGame); } private var newGame:Object; public function _showPopup(x:Number, y:Number, newGame:Object):Void { if (inited) { this.newGame = newGame; hideNewGame( newGame ); conn.send( sendConnName, 'showPopup', x, y); } } private function hideNewGame(newGame:Object):Void { if ((newGame instanceof MovieClip) || (newGame instanceof Button) || (newGame instanceof TextField)) { newGame._visible = false; } } private function showNewGame(newGame:Object):Void { if ((newGame instanceof MovieClip) || (newGame instanceof Button) || (newGame instanceof TextField)) { newGame._visible = true; } else if (newGame instanceof Function) { newGame(); } } public function _showNewGame():Void { showNewGame(newGame); newGame = null; } private function conn_showNewGame():Void { Apitech.instance._showNewGame(); } static public function mouseHide():Void { instance._mouseHide(); } public function _mouseHide():Void { if (inited) { conn.send( sendConnName, 'mouseHide'); } } static public function mouseShow():Void { instance._mouseShow(); } public function _mouseShow():Void { if (inited) { conn.send( sendConnName, 'mouseShow'); } } public var _mouseManager:Boolean = true; public function _setMouseManager(value:Boolean):Void { _mouseManager = value; if (inited) { if (value) { conn.send( sendConnName, 'mouseEnable' ); } else { conn.send( sendConnName, 'mouseDisable' ); } } } static function get mouseManager():Boolean { return instance._mouseManager; } static function set mouseManager(value:Boolean):Void { instance._setMouseManager( value ); } static public function log():Void { instance._log.apply(instance, arguments); } public function _log():Void { if (inited) { conn.send( sendConnName, 'log', [].join.call(arguments, ' ') ); } } }
Не могу понять в чем лажа, я сам в программировании не силен, так что попрошу говорить максимально понятным языком. Спасибо.Добавлено (15.12.2013, 23:00) --------------------------------------------- Новая ошибка Scene 1 Найдено несколько определений конструктора. Возможно, в коде <Script/> не определен конструктор.
Добавлено (15.12.2013, 23:26) --------------------------------------------- и снова
Scene 1, слой "actions", кадр 1, строка 32 1083: Синтаксическая ошибка: package не ожидается