Changeset View
Changeset View
Standalone View
Standalone View
support/aphlict/client/src/AphlictClient.as
| Show All 35 Lines | final public class AphlictClient extends Aphlict { | ||||
| public function AphlictClient() { | public function AphlictClient() { | ||||
| super(); | super(); | ||||
| loaderInfo.uncaughtErrorEvents.addEventListener( | loaderInfo.uncaughtErrorEvents.addEventListener( | ||||
| UncaughtErrorEvent.UNCAUGHT_ERROR, | UncaughtErrorEvent.UNCAUGHT_ERROR, | ||||
| this.uncaughtErrorHandler); | this.uncaughtErrorHandler); | ||||
| ExternalInterface.marshallExceptions = true; | |||||
| ExternalInterface.addCallback('connect', this.externalConnect); | ExternalInterface.addCallback('connect', this.externalConnect); | ||||
| this.setStatus('ready'); | this.setStatus('ready'); | ||||
| } | } | ||||
| private function uncaughtErrorHandler(event:UncaughtErrorEvent):void { | private function uncaughtErrorHandler(event:UncaughtErrorEvent):void { | ||||
| this.error(event.error.toString()); | this.error(event.error.toString()); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | final public class AphlictClient extends Aphlict { | ||||
| * Receive a message from the Aphlict Server, via the | * Receive a message from the Aphlict Server, via the | ||||
| * @{class:AphlictMaster}. | * @{class:AphlictMaster}. | ||||
| */ | */ | ||||
| public function receiveMessage(msg:Object):void { | public function receiveMessage(msg:Object):void { | ||||
| this.log('Received message.'); | this.log('Received message.'); | ||||
| this.externalInvoke('receive', msg); | this.externalInvoke('receive', msg); | ||||
| } | } | ||||
| public function setStatus(status:String, code:String = null):void { | |||||
| this.externalInvoke('status', {type: status, code: code}); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||