1 <?xml version="1.0" encoding="utf-8"?>
2 <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
3 xmlns:components="com.adobe.sync.components.*"
5 minWidth="200" minHeight="200" backgroundColor="#CCCCCC" layout="absolute">
9 import com.adobe.sync.events.SyncSwfEvent;
11 import mx.controls.Alert;
12 import mx.core.UIComponent;
13 import mx.events.FlexEvent;
14 import mx.rpc.events.FaultEvent;
16 import models.CustomSyncMessage;
17 import models.Settings;
19 [bindable] public var settings:Settings;
20 private var comp:UIComponent;
22 public function syncConnector_caughtUpHandler():void {
24 settings = new Settings(syncConnector);
25 // settings.syncConnector.addEventListener(SyncSwfEvent.ROLE_CHANGED,syncConnector_roleChangedHandler);
26 settings.syncConnector.allowParticipantPublish(CustomSyncMessage.USER_ADD_MSG, true);
27 settings.syncConnector.allowParticipantPublish(CustomSyncMessage.PARTICIPANT_INVALID_ID, true);
28 settings.loadComplete = true;
32 // protected function syncConnector_roleChangedHandler(event:SyncSwfEvent):void {
36 protected function toggleInterface():void {
37 mainContainer.removeAllChildren();
40 if(settings.syncConnector.role == "owner" ){
43 else if(settings.syncConnector.role == "presenter"){
44 comp = new Presenter();
47 comp = new Participant();
49 mainContainer.addChild(comp);
52 public function clearInterface():void {
53 mainContainer.removeAllChildren();
58 private function clearGC():void {
60 new LocalConnection().connect('foo');
61 new LocalConnection().connect('foo');
67 public var logText:String = "";
68 public function LOG(msg:String):void{
69 txtLog.text += msg + "\n";
70 logText += msg + "_cr_";
73 public function cpeservice_faultHandler(event:FaultEvent):void{
74 var message:String = "Unable to connect to cpeonlinewebcast server.";
76 if(settings.syncConnector.role == "viewer"){
77 message += "\n Please click 'Show Log' and copy the contents of the log to send to the meeting host.";
78 hLogButtons.visible = true;
79 hLogButtons.includeInLayout = true;
80 btnShowLog.visible = true;
81 btnShowLog.includeInLayout = true;
86 public function connectservice_faultHandler(event:FaultEvent):void{
87 Alert.show("Unable to connect to Adobe connect server.");
90 protected function btnShowLog_clickHandler(event:MouseEvent):void
94 txtLog.percentHeight = 80;
95 txtLog.visible = true;
96 txtLog.includeInLayout = true;
97 btnShowLog.visible = false;
98 btnShowLog.includeInLayout = false;
99 btnHideLog.visible = true;
100 btnHideLog.includeInLayout = true;
103 protected function btnHideLog_clickHandler(event:MouseEvent):void
105 txtLog.visible = false;
106 txtLog.includeInLayout = false;
107 btnHideLog.visible = false;
108 btnHideLog.includeInLayout = false;
109 hLogButtons.visible = false;
110 hLogButtons.includeInLayout = false;
116 <mx:VBox id="mainContainer" width="100%" height="100%"/>
117 <mx:TextArea id="txtLog" left="10" bottom="10" width="100%" height="100" text="" visible="false" includeInLayout="false"/>
118 <mx:HBox width="100%" id="hLogButtons" visible="false" includeInLayout="false">
119 <mx:Button id="btnShowLog" label="Show Log" visible="false" includeInLayout="false" click="btnShowLog_clickHandler(event)" />
120 <mx:Button id="btnHideLog" label="Hide Log" visible="false" includeInLayout="false" click="btnHideLog_clickHandler(event)" />
122 <components:SyncConnector id="syncConnector" caughtUp="syncConnector_caughtUpHandler()"/>