Changeset View
Changeset View
Standalone View
Standalone View
support/aphlict/client/src/AphlictClient.as
| package { | package { | ||||
| import flash.events.TimerEvent; | import flash.events.TimerEvent; | ||||
| import flash.external.ExternalInterface; | import flash.external.ExternalInterface; | ||||
| import flash.utils.Dictionary; | import flash.utils.Dictionary; | ||||
| import flash.utils.Timer; | import flash.utils.Timer; | ||||
| import flash.events.UncaughtErrorEvent; | |||||
| final public class AphlictClient extends Aphlict { | final public class AphlictClient extends Aphlict { | ||||
| /** | /** | ||||
| * The connection name for this client. This will be used for the | * The connection name for this client. This will be used for the | ||||
| * @{class:LocalConnection} object. | * @{class:LocalConnection} object. | ||||
| */ | */ | ||||
| private var client:String; | private var client:String; | ||||
| Show All 16 Lines | final public class AphlictClient extends Aphlict { | ||||
| private var remoteServer:String; | private var remoteServer:String; | ||||
| private var remotePort:Number; | private var remotePort:Number; | ||||
| private var subscriptions:Array; | private var subscriptions:Array; | ||||
| public function AphlictClient() { | public function AphlictClient() { | ||||
| super(); | super(); | ||||
| loaderInfo.uncaughtErrorEvents.addEventListener( | |||||
| UncaughtErrorEvent.UNCAUGHT_ERROR, | |||||
| this.uncaughtErrorHandler); | |||||
| ExternalInterface.addCallback('connect', this.externalConnect); | ExternalInterface.addCallback('connect', this.externalConnect); | ||||
| ExternalInterface.call( | ExternalInterface.call( | ||||
| 'JX.Stratcom.invoke', | 'JX.Stratcom.invoke', | ||||
| 'aphlict-component-ready', | 'aphlict-component-ready', | ||||
| null, | null, | ||||
| {}); | {}); | ||||
| } | } | ||||
| private function uncaughtErrorHandler(event:UncaughtErrorEvent):void { | |||||
| this.error(event.error.toString()); | |||||
| } | |||||
| public function externalConnect( | public function externalConnect( | ||||
| server:String, | server:String, | ||||
| port:Number, | port:Number, | ||||
| subscriptions:Array):void { | subscriptions:Array):void { | ||||
| this.externalInvoke('connect'); | this.externalInvoke('connect'); | ||||
| this.remoteServer = server; | this.remoteServer = server; | ||||
| ▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines | |||||