| 50 | | } |
| 51 | | |
| | 71 | } |
| | 72 | |
| | 73 | private function changeSize(event:Event):void { |
| | 74 | if (event.currentTarget.selectedIndex == 0) |
| | 75 | cam.setMode(160,120,25); |
| | 76 | if (event.currentTarget.selectedIndex == 1) |
| | 77 | cam.setMode(384,288,25); |
| | 78 | if (event.currentTarget.selectedIndex == 2) |
| | 79 | cam.setMode(400,300,25); |
| | 80 | if (event.currentTarget.selectedIndex == 3) |
| | 81 | cam.setMode(640,480,25); |
| | 82 | if (event.currentTarget.selectedIndex == 4) |
| | 83 | cam.setMode(768,576,25); |
| | 84 | if (event.currentTarget.selectedIndex == 5) |
| | 85 | cam.setMode(800,600,25); |
| | 86 | |
| | 87 | Alert.show( |
| | 88 | 'Note that only few webcam models support all sizes.\n'+ |
| | 89 | 'Camera size is now:\n'+ |
| | 90 | 'width:'+cam.width+'\n'+ |
| | 91 | 'height:'+cam.height+'\n'+ |
| | 92 | 'fps:'+cam.fps+'\n' |
| | 93 | , 'Camera Info', mx.controls.Alert.OK); |
| | 94 | } |
| | 95 | |
| | 132 | private function onTacFault(event:FaultEvent):void |
| | 133 | { |
| | 134 | Alert.show('HTTP error:\n'+event.toString(),'Alert.', mx.controls.Alert.OK); |
| | 135 | bt.selected=false; |
| | 136 | } |
| | 137 | |
| | 138 | private function onTacLoad(event:ResultEvent):void |
| | 139 | { |
| | 140 | var rawData:String = String(event.result); |
| | 141 | if (rawData=="") { |
| | 142 | Alert.show('invalid project name or password.','Alert.', mx.controls.Alert.OK); |
| | 143 | bt.selected=false; |
| | 144 | return; |
| | 145 | } |
| | 146 | // Alert.show('wiki:\n'+rawData,'Debug.', mx.controls.Alert.OK); |
| | 147 | var mp:RegExp = /[^a-zA-Z0-9,;]/g; |
| | 148 | uploadName = baseName+"-("+rawData.replace(mp,"").replace(" ","_")+")"; |
| | 149 | // Alert.show('uploadName: '+uploadName,'Debug.', mx.controls.Alert.OK); |
| | 150 | launchConnection(); |
| | 151 | } |
| | 152 | |
| 95 | | uploadName=baseName+"-("+tg.text.replace(" ","_")+")"; |
| | 162 | uploadName = baseName+"-(" |
| | 163 | +tg.text.replace(/, /g,",").replace(/ /g,"").replace(/ /g,"_")+';' |
| | 164 | +tt.text.replace(/ /g,"_")+';' |
| | 165 | +ta.text.replace(/ /g,"_")+';' |
| | 166 | +td.text.replace(/ /g,"_") |
| | 167 | +")"; |
| | 168 | launchConnection(); |
| | 169 | } else { |
| | 170 | service.send({id:"projects/"+tu.text.replace(" ,","_"), password:tp.text}); |
| | 171 | } |
| | 172 | } |
| | 173 | |
| | 174 | private function launchConnection():void |
| | 175 | { |
| | 176 | // Alert.show('uploadName: '+uploadName,'Debug.', mx.controls.Alert.OK); |
| 131 | | |
| 132 | | <mx:VideoDisplay id="video" width="340" height="280" /> |
| 133 | | <mx:Box direction="horizontal" > |
| 134 | | <mx:Label text="Tags:" /> |
| 135 | | <mx:TextInput id="tg" width="150" text="Live,Camera" restrict="a-zA-Z0-9, " maxChars="64"/> |
| 136 | | <mx:Button id="bt" toggle="true" change="camBt(event)" label="Start Camera"/> |
| | 224 | |
| | 225 | <mx:Box direction="horizontal" width="100%"> |
| | 226 | <mx:Text> |
| | 227 | <mx:htmlText> |
| | 228 | <![CDATA[<font size="20px">TheArtCollider</font>]]> |
| | 229 | </mx:htmlText> |
| | 230 | </mx:Text> |
| | 231 | <mx:Spacer width="100%"/> |
| | 232 | <mx:Text width="207"> |
| | 233 | <mx:htmlText> |
| | 234 | <![CDATA[Step 1: Set Meta-Info <b>or</b> specify project ID]]> |
| | 235 | </mx:htmlText> |
| | 236 | </mx:Text> |
| | 237 | </mx:Box> |
| | 238 | |
| | 239 | <mx:TabNavigator id="tabs" borderStyle="solid" width="100%"> |
| | 240 | <mx:VBox label="Enter meta-data by hand" |
| | 241 | width="100%" |
| | 242 | height="75"> |
| | 243 | <mx:Box direction="horizontal" > |
| | 244 | <mx:Label width="40" text="Title:" /> |
| | 245 | <mx:TextInput id="tt" width="150" text="Title" restrict="a-zA-Z0-9, " maxChars="64"/> |
| | 246 | <mx:Label width="50" text="Author:" /> |
| | 247 | <mx:TextInput id="ta" width="150" text="me" restrict="a-zA-Z0-9, " maxChars="64"/> |
| | 248 | </mx:Box> |
| | 249 | <mx:Box direction="horizontal" > |
| | 250 | <mx:Label width="40" text="Desc:" /> |
| | 251 | <mx:TextInput id="td" width="150" text="My Web Camera" restrict="a-zA-Z0-9, " maxChars="64"/> |
| | 252 | <mx:Label width="50" text="Tags:" /> |
| | 253 | <mx:TextInput id="tg" width="150" text="Live, Camera" restrict="a-zA-Z0-9, " maxChars="64"/> |
| | 254 | </mx:Box> |
| | 255 | </mx:VBox> |
| | 256 | <mx:VBox label="Get meta-data from wiki" |
| | 257 | width="100%" |
| | 258 | height="75"> |
| | 259 | <mx:Box direction="horizontal" > |
| | 260 | <mx:Label width="40" text="ID:" /> |
| | 261 | <mx:TextInput id="tu" width="150" text="myProject" restrict="a-zA-Z0-9_ " maxChars="64"/> |
| | 262 | <mx:Label width="70" text="Password:"/> |
| | 263 | <mx:TextInput id="tp" width="150" text="" displayAsPassword="true" restrict="a-zA-Z0-9_ " enabled="true" maxChars="64"/> |
| | 264 | |
| | 265 | </mx:Box> |
| | 266 | <mx:Text width="100%"> |
| | 267 | <mx:htmlText> |
| | 268 | <![CDATA[The ID needs to match a project-name created in the <font color="#0000ff"><a href="http://wiki.citu.fr/signup">Wiki</a></font>.<br/>View a list of <font color="#0000ff"><a href="http://wiki.citu.info/projects">registered projects</a></font>.]]> |
| | 269 | </mx:htmlText> |
| | 270 | </mx:Text> |
| | 271 | </mx:VBox> |
| | 272 | </mx:TabNavigator> |
| | 273 | |
| | 274 | <mx:Box direction="horizontal" width="100%"> |
| | 275 | <mx:VideoDisplay id="video" width="340" height="280" /> |
| | 276 | <mx:VBox width="200" height="280"> |
| | 277 | <mx:Text width="180"> |
| | 278 | <mx:htmlText> |
| | 279 | <![CDATA[Step 2: Set up camera (right click -> settings)]]> |
| | 280 | </mx:htmlText> |
| | 281 | </mx:Text> |
| | 282 | <mx:ComboBox id="camsize" change="changeSize(event)"> |
| | 283 | <mx:ArrayCollection> |
| | 284 | <mx:String>160x120</mx:String> |
| | 285 | <mx:String>384x288</mx:String> |
| | 286 | <mx:String>400x300</mx:String> |
| | 287 | <mx:String>640x480</mx:String> |
| | 288 | <mx:String>768x576</mx:String> |
| | 289 | <mx:String>800x600</mx:String> |
| | 290 | </mx:ArrayCollection> |
| | 291 | </mx:ComboBox> |
| | 292 | <mx:Spacer height="100%"/> |
| | 293 | <mx:Label width="180" text="Step 3: Start camera stream" /> |
| | 294 | <mx:Button id="bt" toggle="true" change="camBt(event)" label="Start Camera"/> |
| | 295 | </mx:VBox> |