http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e1f9d1df/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/sample.mxml.html ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/sample.mxml.html b/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/sample.mxml.html new file mode 100644 index 0000000..eb70d50 --- /dev/null +++ b/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/sample.mxml.html @@ -0,0 +1,108 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- saved from url=(0014)about:internet --> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> +<title>sample.mxml</title> +<link rel="stylesheet" type="text/css" href="../SourceStyles.css"/> +</head> + +<body><pre><span class="MXMLProcessing_Instruction"><?xml version="1.0" encoding="utf-8"?></span> +<span class="MXMLComponent_Tag"><s:WindowedApplication</span><span class="MXMLDefault_Text"> xmlns:fx="</span><span class="MXMLString">http://ns.adobe.com/mxml/2009</span><span class="MXMLDefault_Text">" + xmlns:s="</span><span class="MXMLString">library://ns.adobe.com/flex/spark</span><span class="MXMLDefault_Text">" + xmlns:mx="</span><span class="MXMLString">library://ns.adobe.com/flex/mx</span><span class="MXMLDefault_Text">" + styleName="</span><span class="MXMLString">plain</span><span class="MXMLDefault_Text">" width="</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">" height="</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">" creationComplete="</span><span class="ActionScriptDefault_Text">init</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">></span> + <span class="MXMLSpecial_Tag"><fx:Script></span> + <![CDATA[ + <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">events</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">StorageVolumeChangeEvent</span>; + <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">controls</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">Alert</span>; + + <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">rootDir</span>:<span class="ActionScriptDefault_Text">File</span>; + + <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">path</span>:<span class="ActionScriptDefault_Text">String</span>; + + <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">init</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">StorageVolumeInfo</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">isSupported</span><span class="ActionScriptBracket/Brace">)</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptDefault_Text">StorageVolumeInfo</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">storageVolumeInfo</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">StorageVolumeChangeEvent</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">STORAGE_VOLUME_MOUNT</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">onVolumeMount</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptDefault_Text">StorageVolumeInfo</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">storageVolumeInfo</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">StorageVolumeChangeEvent</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">STORAGE_VOLUME_UNMOUNT</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">onVolumeUnmount</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptBracket/Brace">}</span> + <span class="ActionScriptReserved">else</span> <span class="ActionScriptDefault_Text">Alert</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">show</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"AIR 2 storage detection is not supported."</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptBracket/Brace">}</span> + + <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onVolumeMount</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">e</span>:<span class="ActionScriptDefault_Text">StorageVolumeChangeEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptReserved">this</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">deviceName</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">text</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">e</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">storageVolume</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">name</span>; + <span class="ActionScriptReserved">this</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">fileSystemType</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">text</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">e</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">storageVolume</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">fileSystemType</span>; + <span class="ActionScriptReserved">this</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">isRemovable</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">selected</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">e</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">storageVolume</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">isRemovable</span>; + <span class="ActionScriptReserved">this</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">isWritable</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">selected</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">e</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">storageVolume</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">isWritable</span>; + <span class="ActionScriptDefault_Text">rootDir</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">e</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">storageVolume</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">rootDirectory</span>; + <span class="ActionScriptDefault_Text">path</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">rootDir</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">nativePath</span>; + <span class="ActionScriptBracket/Brace">}</span> + + <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onVolumeUnmount</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">e</span>:<span class="ActionScriptDefault_Text">StorageVolumeChangeEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScripttrace">trace</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"Storage Volume unmount."</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptBracket/Brace">}</span> + + <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">fileGridHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">fsg</span>:<span class="ActionScriptDefault_Text">FileSystemDataGrid</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">currentTarget</span> <span class="ActionScriptReserved">as</span> <span class="ActionScriptDefault_Text">FileSystemDataGrid</span>; + <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">fsg</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">selectedItem</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span> + <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">fsg</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">selectedItem</span> <span class="ActionScriptReserved">as</span> <span class="ActionScriptDefault_Text">File</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">openWithDefaultApplication</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptBracket/Brace">}</span> + <span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">></span> + <span class="MXMLSpecial_Tag"></fx:Script></span> + + <span class="MXMLComponent_Tag"><s:Panel</span><span class="MXMLDefault_Text"> width="</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">" height="</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">" horizontalCenter="</span><span class="MXMLString">0</span><span class="MXMLDefault_Text">" + title="</span><span class="MXMLString">Mass Storage Device Detection Sample</span><span class="MXMLDefault_Text">" skinClass="</span><span class="MXMLString">skins.TDFPanelSkin</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">></span> + + <span class="MXMLComponent_Tag"><s:layout></span> + <span class="MXMLComponent_Tag"><s:VerticalLayout</span><span class="MXMLDefault_Text"> paddingLeft="</span><span class="MXMLString">7</span><span class="MXMLDefault_Text">" paddingTop="</span><span class="MXMLString">7</span><span class="MXMLDefault_Text">" paddingBottom="</span><span class="MXMLString">7</span><span class="MXMLDefault_Text">" paddingRight="</span><span class="MXMLString">7</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"></s:layout></span> + + <span class="MXMLComponent_Tag"><s:HGroup</span><span class="MXMLDefault_Text"> verticalAlign="</span><span class="MXMLString">middle</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">></span> + <span class="MXMLComponent_Tag"><s:Label</span><span class="MXMLDefault_Text"> text="</span><span class="MXMLString">Storage Volume Info</span><span class="MXMLDefault_Text">" fontSize="</span><span class="MXMLString">14</span><span class="MXMLDefault_Text">" fontWeight="</span><span class="MXMLString">bold</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"><mx:Spacer</span><span class="MXMLDefault_Text"> width="</span><span class="MXMLString">70</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"><s:Label</span><span class="MXMLDefault_Text"> text="</span><span class="MXMLString">Plug in a storage device to detect general information and contents of the device.</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"></s:HGroup></span> + <span class="MXMLComponent_Tag"><s:HGroup</span><span class="MXMLDefault_Text"> verticalAlign="</span><span class="MXMLString">middle</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">></span> + <span class="MXMLComponent_Tag"><s:Label</span><span class="MXMLDefault_Text"> text="</span><span class="MXMLString">Name:</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"><s:Label</span><span class="MXMLDefault_Text"> id="</span><span class="MXMLString">deviceName</span><span class="MXMLDefault_Text">" color="</span><span class="MXMLString">0x336699</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"><s:Label</span><span class="MXMLDefault_Text"> text="</span><span class="MXMLString">File System Type:</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"><s:Label</span><span class="MXMLDefault_Text"> id="</span><span class="MXMLString">fileSystemType</span><span class="MXMLDefault_Text">" color="</span><span class="MXMLString">0x336699</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"></s:HGroup></span> + + <span class="MXMLComponent_Tag"><s:Label</span><span class="MXMLDefault_Text"> text="</span><span class="MXMLString">Contents of {</span><span class="ActionScriptDefault_Text">path</span><span class="MXMLString">}</span><span class="MXMLDefault_Text">" fontWeight="</span><span class="MXMLString">bold</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + + <span class="MXMLComponent_Tag"><mx:FileSystemDataGrid</span><span class="MXMLDefault_Text"> id="</span><span class="MXMLString">fileGrid</span><span class="MXMLDefault_Text">" width="</span><span class="MXMLString">660</span><span class="MXMLDefault_Text">" height="</span><span class="MXMLString">100</span><span class="MXMLDefault_Text">" directory="</span><span class="MXMLString">{</span><span class="ActionScriptDefault_Text">rootDir</span><span class="MXMLString">}</span><span class="MXMLDefault_Text">" + doubleClickEnabled="</span><span class="MXMLString">true</span><span class="MXMLDefault_Text">" doubleClick="</span><span class="ActionScriptDefault_Text">fileGridHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">></span> + <span class="MXMLComponent_Tag"></mx:FileSystemDataGrid></span> + <span class="MXMLComponent_Tag"><s:HGroup</span><span class="MXMLDefault_Text"> right="</span><span class="MXMLString">20</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">></span> + <span class="MXMLComponent_Tag"><mx:Button</span><span class="MXMLDefault_Text"> icon="</span><span class="MXMLString">@Embed(source='up.png')</span><span class="MXMLDefault_Text">" click="</span><span class="ActionScriptDefault_Text">fileGrid</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">navigateUp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;<span class="MXMLDefault_Text">" + enabled="</span><span class="MXMLString">{</span><span class="ActionScriptDefault_Text">fileGrid</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">canNavigateUp</span><span class="MXMLString">}</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"><mx:Spacer</span><span class="MXMLDefault_Text"> width="</span><span class="MXMLString">330</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"><s:CheckBox</span><span class="MXMLDefault_Text"> id="</span><span class="MXMLString">isRemovable</span><span class="MXMLDefault_Text">" label="</span><span class="MXMLString">Removable Device?</span><span class="MXMLDefault_Text">" enabled="</span><span class="MXMLString">false</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"><s:CheckBox</span><span class="MXMLDefault_Text"> id="</span><span class="MXMLString">isWritable</span><span class="MXMLDefault_Text">" label="</span><span class="MXMLString">Writable Device?</span><span class="MXMLDefault_Text">" enabled="</span><span class="MXMLString">false</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"></s:HGroup></span> + <span class="MXMLComponent_Tag"></s:Panel></span> + +<span class="MXMLComponent_Tag"></s:WindowedApplication></span></pre></body> +</html>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e1f9d1df/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/skins/TDFPanelSkin.mxml.html ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/skins/TDFPanelSkin.mxml.html b/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/skins/TDFPanelSkin.mxml.html new file mode 100644 index 0000000..df79d11 --- /dev/null +++ b/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/skins/TDFPanelSkin.mxml.html @@ -0,0 +1,147 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <meta http-equiv="Content-Style-Type" content="text/css"> + <title>TDFPanelSkin.mxml</title> + <meta name="Generator" content="Cocoa HTML Writer"> + <meta name="CocoaVersion" content="1187.4"> + <style type="text/css"> + p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier} + p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #941100} + p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px} + p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px} + </style> +</head> +<body> +<p class="p1"><?xml version="1.0" encoding="utf-8"?></p> +<p class="p2"><!--</p> +<p class="p3"><br></p> +<p class="p2">Licensed to the Apache Software Foundation (ASF) under one or more</p> +<p class="p2">contributor license agreements.<span class="Apple-converted-space">Â </span>See the NOTICE file distributed with</p> +<p class="p2">this work for additional information regarding copyright ownership.</p> +<p class="p2">The ASF licenses this file to You under the Apache License, Version 2.0</p> +<p class="p2">(the "License"); you may not use this file except in compliance with</p> +<p class="p2">the License.<span class="Apple-converted-space">Â </span>You may obtain a copy of the License at</p> +<p class="p3"><br></p> +<p class="p2">http://www.apache.org/licenses/LICENSE-2.0</p> +<p class="p3"><br></p> +<p class="p2">Unless required by applicable law or agreed to in writing, software</p> +<p class="p2">distributed under the License is distributed on an "AS IS" BASIS,</p> +<p class="p2">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</p> +<p class="p2">See the License for the specific language governing permissions and</p> +<p class="p2">limitations under the License.</p> +<p class="p3"><br></p> +<p class="p2">--></p> +<p class="p4"><br></p> +<p class="p1"><s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"<span class="Apple-converted-space">Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span>alpha.disabled="0.5" minWidth="131" minHeight="127"></p> +<p class="p4"><span class="Apple-converted-space">Â Â Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â </span><fx:Metadata></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span>[HostComponent("spark.components.Panel")]</p> +<p class="p1"><span class="Apple-converted-space">Â Â </span></fx:Metadata><span class="Apple-converted-space">Â </span></p> +<p class="p4"><span class="Apple-converted-space">Â Â Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â </span><s:states></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span><s:State name="normal" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span><s:State name="disabled" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span><s:State name="normalWithControlBar" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span><s:State name="disabledWithControlBar" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â </span></s:states></p> +<p class="p4"><span class="Apple-converted-space">Â Â Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â </span><!-- drop shadow --></p> +<p class="p1"><span class="Apple-converted-space">Â Â </span><s:Rect left="0" top="0" right="0" bottom="0"></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span><s:filters></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><s:DropShadowFilter blurX="15" blurY="15" alpha="0.18" distance="11" angle="90" knockout="true" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span></s:filters></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span><s:fill></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><s:SolidColor color="0" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span></s:fill></p> +<p class="p1"><span class="Apple-converted-space">Â Â </span></s:Rect></p> +<p class="p4"><span class="Apple-converted-space">Â Â Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â </span><!-- layer 1: border --></p> +<p class="p1"><span class="Apple-converted-space">Â Â </span><s:Rect left="0" right="0" top="0" bottom="0"></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span><s:stroke></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><s:SolidColorStroke color="0" alpha="0.50" weight="1" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span></s:stroke></p> +<p class="p1"><span class="Apple-converted-space">Â Â </span></s:Rect></p> +<p class="p4"><span class="Apple-converted-space">Â Â Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â </span><!-- layer 2: background fill --></p> +<p class="p1"><span class="Apple-converted-space">Â Â </span><s:Rect left="0" right="0" bottom="0" height="15"></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span><s:fill></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><s:LinearGradient rotation="90"></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â </span><s:GradientEntry color="0xE2E2E2" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â </span><s:GradientEntry color="0x000000" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span></s:LinearGradient></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span></s:fill></p> +<p class="p1"><span class="Apple-converted-space">Â Â </span></s:Rect></p> +<p class="p4"><span class="Apple-converted-space">Â Â Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â </span><!-- layer 3: contents --></p> +<p class="p1"><span class="Apple-converted-space">Â Â </span><s:Group left="1" right="1" top="1" bottom="1" ></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span><s:layout></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><s:VerticalLayout gap="0" horizontalAlign="justify" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span></s:layout></p> +<p class="p4"><span class="Apple-converted-space">Â Â Â Â Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span><s:Group id="topGroup" ></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><!-- layer 0: title bar fill --></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><!-- Note: We have custom skinned the title bar to be solid black for Tour de Flex --></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><s:Rect id="tbFill" left="0" right="0" top="0" bottom="1" ></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â </span><s:fill></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â Â Â </span><s:SolidColor color="0x000000" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â </span></s:fill></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span></s:Rect></p> +<p class="p4"><span class="Apple-converted-space">Â Â Â Â Â Â Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><!-- layer 1: title bar highlight --></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><s:Rect id="tbHilite" left="0" right="0" top="0" bottom="0" ></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â </span><s:stroke></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â Â Â </span><s:LinearGradientStroke rotation="90" weight="1"></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â Â Â Â Â </span><s:GradientEntry color="0xEAEAEA" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â Â Â Â Â </span><s:GradientEntry color="0xD9D9D9" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â Â Â </span></s:LinearGradientStroke></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â </span></s:stroke></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span></s:Rect></p> +<p class="p4"><span class="Apple-converted-space">Â Â Â Â Â Â Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><!-- layer 2: title bar divider --></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><s:Rect id="tbDiv" left="0" right="0" height="1" bottom="0"></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â </span><s:fill></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â Â Â </span><s:SolidColor color="0xC0C0C0" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â </span></s:fill></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span></s:Rect></p> +<p class="p4"><span class="Apple-converted-space">Â Â Â Â Â Â Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><!-- layer 3: text --></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><s:Label id="titleDisplay" maxDisplayedLines="1"</p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â Â Â Â </span>left="9" right="3" top="1" minHeight="30"</p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â Â Â Â </span>verticalAlign="middle" fontWeight="bold" color="#E2E2E2"></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span></s:Label></p> +<p class="p4"><span class="Apple-converted-space">Â Â Â Â Â Â Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span></s:Group></p> +<p class="p4"><span class="Apple-converted-space">Â Â Â Â Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span><s:Group id="contentGroup" width="100%" height="100%" minWidth="0" minHeight="0"></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span></s:Group></p> +<p class="p4"><span class="Apple-converted-space">Â Â Â Â Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span><s:Group id="bottomGroup" minWidth="0" minHeight="0"</p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â Â </span>includeIn="normalWithControlBar, disabledWithControlBar" ></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><!-- layer 0: control bar background --></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><s:Rect left="0" right="0" bottom="0" top="1" ></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â </span><s:fill></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â Â Â </span><s:SolidColor color="0xE2EdF7" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â </span></s:fill></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span></s:Rect></p> +<p class="p4"><span class="Apple-converted-space">Â Â Â Â Â Â Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><!-- layer 1: control bar divider line --></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><s:Rect left="0" right="0" top="0" height="1" ></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â </span><s:fill></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â Â Â </span><s:SolidColor color="0xD1E0F2" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â </span></s:fill></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span></s:Rect></p> +<p class="p4"><span class="Apple-converted-space">Â Â Â Â Â Â Â </span></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><!-- layer 2: control bar --></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span><s:Group id="controlBarGroup" left="0" right="0" top="1" bottom="1" minWidth="0" minHeight="0"></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â </span><s:layout></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â Â Â </span><s:HorizontalLayout paddingLeft="10" paddingRight="10" paddingTop="7" paddingBottom="7" gap="10" /></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â Â Â </span></s:layout></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â Â Â </span></s:Group></p> +<p class="p1"><span class="Apple-converted-space">Â Â Â Â </span></s:Group></p> +<p class="p1"><span class="Apple-converted-space">Â Â </span></s:Group></p> +<p class="p1"></s:Skin></p> +</body> +</html> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e1f9d1df/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/up.png ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/up.png b/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/up.png new file mode 100644 index 0000000..4bf79b0 Binary files /dev/null and b/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/up.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e1f9d1df/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/up.png.html ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/up.png.html b/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/up.png.html new file mode 100644 index 0000000..bc5ccd9 --- /dev/null +++ b/TourDeFlex/TourDeFlex/src/objects/AIR20/MassStorageDeviceDetection/srcview/source/up.png.html @@ -0,0 +1,28 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- saved from url=(0014)about:internet --> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> +<title>up.png</title> +</head> + +<body> +<img src="up.png" border="0"/> +</body> +</html> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e1f9d1df/TourDeFlex/TourDeFlex/src/objects/AIR20/Microphone/source/com/adobe/audio/format/WAVWriter.as.html ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex/src/objects/AIR20/Microphone/source/com/adobe/audio/format/WAVWriter.as.html b/TourDeFlex/TourDeFlex/src/objects/AIR20/Microphone/source/com/adobe/audio/format/WAVWriter.as.html new file mode 100644 index 0000000..9af6e87 --- /dev/null +++ b/TourDeFlex/TourDeFlex/src/objects/AIR20/Microphone/source/com/adobe/audio/format/WAVWriter.as.html @@ -0,0 +1,16 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e1f9d1df/TourDeFlex/TourDeFlex/src/objects/AIR20/Microphone/source/sample-app.xml.txt ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex/src/objects/AIR20/Microphone/source/sample-app.xml.txt b/TourDeFlex/TourDeFlex/src/objects/AIR20/Microphone/source/sample-app.xml.txt new file mode 100755 index 0000000..21dad49 --- /dev/null +++ b/TourDeFlex/TourDeFlex/src/objects/AIR20/Microphone/source/sample-app.xml.txt @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?> +<!-- + +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +--> +<application xmlns="http://ns.adobe.com/air/application/2.0"> + +<!-- Adobe AIR Application Descriptor File Template. + + Specifies parameters for identifying, installing, and launching AIR applications. + + xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/2.0beta + The last segment of the namespace specifies the version + of the AIR runtime required for this application to run. + + minimumPatchLevel - The minimum patch level of the AIR runtime required to run + the application. Optional. +--> + + <!-- The application identifier string, unique to this application. Required. --> + <id>main</id> + + <!-- Used as the filename for the application. Required. --> + <filename>main</filename> + + <!-- The name that is displayed in the AIR application installer. + May have multiple values for each language. See samples or xsd schema file. Optional. --> + <name>main</name> + + <!-- An application version designator (such as "v1", "2.5", or "Alpha 1"). Required. --> + <version>v1</version> + + <!-- Description, displayed in the AIR application installer. + May have multiple values for each language. See samples or xsd schema file. Optional. --> + <!-- <description></description> --> + + <!-- Copyright information. Optional --> + <!-- <copyright></copyright> --> + + <!-- Settings for the application's initial window. Required. --> + <initialWindow> + <!-- The main SWF or HTML file of the application. Required. --> + <!-- Note: In Flash Builder, the SWF reference is set automatically. --> + <content>[This value will be overwritten by Flash Builder in the output app.xml]</content> + + <!-- The title of the main window. Optional. --> + <!-- <title></title> --> + + <!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. --> + <!-- <systemChrome></systemChrome> --> + + <!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. --> + <!-- <transparent></transparent> --> + + <!-- Whether the window is initially visible. Optional. Default false. --> + <!-- <visible></visible> --> + + <!-- Whether the user can minimize the window. Optional. Default true. --> + <!-- <minimizable></minimizable> --> + + <!-- Whether the user can maximize the window. Optional. Default true. --> + <!-- <maximizable></maximizable> --> + + <!-- Whether the user can resize the window. Optional. Default true. --> + <!-- <resizable></resizable> --> + + <!-- The window's initial width. Optional. --> + <!-- <width></width> --> + + <!-- The window's initial height. Optional. --> + <!-- <height></height> --> + + <!-- The window's initial x position. Optional. --> + <!-- <x></x> --> + + <!-- The window's initial y position. Optional. --> + <!-- <y></y> --> + + <!-- The window's minimum size, specified as a width/height pair, such as "400 200". Optional. --> + <!-- <minSize></minSize> --> + + <!-- The window's initial maximum size, specified as a width/height pair, such as "1600 1200". Optional. --> + <!-- <maxSize></maxSize> --> + </initialWindow> + + <!-- The subpath of the standard default installation location to use. Optional. --> + <!-- <installFolder></installFolder> --> + + <!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. --> + <!-- <programMenuFolder></programMenuFolder> --> + + <!-- The icon the system uses for the application. For at least one resolution, + specify the path to a PNG file included in the AIR package. Optional. --> + <!-- <icon> + <image16x16></image16x16> + <image32x32></image32x32> + <image48x48></image48x48> + <image128x128></image128x128> + </icon> --> + + <!-- Whether the application handles the update when a user double-clicks an update version + of the AIR file (true), or the default AIR application installer handles the update (false). + Optional. Default false. --> + <!-- <customUpdateUI></customUpdateUI> --> + + <!-- Whether the application can be launched when the user clicks a link in a web browser. + Optional. Default false. --> + <!-- <allowBrowserInvocation></allowBrowserInvocation> --> + + <!-- Listing of file types for which the application can register. Optional. --> + <!-- <fileTypes> --> + + <!-- Defines one file type. Optional. --> + <!-- <fileType> --> + + <!-- The name that the system displays for the registered file type. Required. --> + <!-- <name></name> --> + + <!-- The extension to register. Required. --> + <!-- <extension></extension> --> + + <!-- The description of the file type. Optional. --> + <!-- <description></description> --> + + <!-- The MIME content type. --> + <!-- <contentType></contentType> --> + + <!-- The icon to display for the file type. Optional. --> + <!-- <icon> + <image16x16></image16x16> + <image32x32></image32x32> + <image48x48></image48x48> + <image128x128></image128x128> + </icon> --> + + <!-- </fileType> --> + <!-- </fileTypes> --> + +</application> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e1f9d1df/TourDeFlex/TourDeFlex/src/objects/AIR20/Microphone/source/sample.mxml.html ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex/src/objects/AIR20/Microphone/source/sample.mxml.html b/TourDeFlex/TourDeFlex/src/objects/AIR20/Microphone/source/sample.mxml.html new file mode 100644 index 0000000..82660fe --- /dev/null +++ b/TourDeFlex/TourDeFlex/src/objects/AIR20/Microphone/source/sample.mxml.html @@ -0,0 +1,202 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- saved from url=(0014)about:internet --> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> +<title>sample.mxml</title> +<link rel="stylesheet" type="text/css" href="../SourceStyles.css"/> +</head> + +<body><pre><span class="MXMLProcessing_Instruction"><?xml version="1.0" encoding="utf-8"?></span> +<span class="MXMLComponent_Tag"><mx:Module</span><span class="MXMLDefault_Text"> xmlns:fx="</span><span class="MXMLString">http://ns.adobe.com/mxml/2009</span><span class="MXMLDefault_Text">" + xmlns:s="</span><span class="MXMLString">library://ns.adobe.com/flex/spark</span><span class="MXMLDefault_Text">" + xmlns:mx="</span><span class="MXMLString">library://ns.adobe.com/flex/mx</span><span class="MXMLDefault_Text">" + creationComplete="</span><span class="ActionScriptDefault_Text">init</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">" </span><span class="MXMLComponent_Tag">></span> + + <span class="MXMLComment"><!--</span><span class="MXMLComment"> LINK TO ARTICLE: http://www.adobe.com/devnet/air/flex/articles/using_mic_api.html </span><span class="MXMLComment">--></span> + <span class="MXMLSpecial_Tag"><fx:Script></span> + <![CDATA[ + <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">adobe</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">audio</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">format</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">WAVWriter</span>; + + <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">events</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">SampleDataEvent</span>; + <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">media</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">Microphone</span>; + <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">media</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">Sound</span>; + <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">utils</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">ByteArray</span>; + + <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">collections</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">ArrayCollection</span>; + + <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">microphoneList</span>:<span class="ActionScriptDefault_Text">ArrayCollection</span>; + <span class="ActionScriptReserved">protected</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">microphone</span>:<span class="ActionScriptDefault_Text">Microphone</span>; + + <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptReserved">protected</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">isRecording</span>:<span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>; + + <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptReserved">protected</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">isPlaying</span>:<span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>; + + <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptReserved">protected</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">soundData</span>:<span class="ActionScriptDefault_Text">ByteArray</span>; + <span class="ActionScriptReserved">protected</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">sound</span>:<span class="ActionScriptDefault_Text">Sound</span>; + <span class="ActionScriptReserved">protected</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">channel</span>:<span class="ActionScriptDefault_Text">SoundChannel</span>; + + <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">init</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptDefault_Text">microphoneList</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">ArrayCollection</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Microphone</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">names</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptDefault_Text">cbMicChoices</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">selectedIndex</span><span class="ActionScriptOperator">=</span>0; + <span class="ActionScriptBracket/Brace">}</span> + + <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">startRecording</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptDefault_Text">isRecording</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>; + <span class="ActionScriptDefault_Text">microphone</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">Microphone</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">getMicrophone</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">cbMicChoices</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">selectedIndex</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptDefault_Text">microphone</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">rate</span> <span class="ActionScriptOperator">=</span> 44; + <span class="ActionScriptDefault_Text">microphone</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">gain</span> <span class="ActionScriptOperator">=</span> 100; + <span class="ActionScriptDefault_Text">soundData</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">ByteArray</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScripttrace">trace</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"Recording"</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptDefault_Text">microphone</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">SampleDataEvent</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">SAMPLE_DATA</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">onSampleDataReceived</span><span class="ActionScriptBracket/Brace">)</span>; + + <span class="ActionScriptBracket/Brace">}</span> + + <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">stopRecording</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptDefault_Text">isRecording</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>; + <span class="ActionScripttrace">trace</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"Stopped recording"</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptDefault_Text">microphone</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">removeEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">SampleDataEvent</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">SAMPLE_DATA</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">onSampleDataReceived</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptBracket/Brace">}</span> + + <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onSampleDataReceived</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">SampleDataEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptReserved">while</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">data</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">bytesAvailable</span><span class="ActionScriptBracket/Brace">)</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">sample</span>:<span class="ActionScriptDefault_Text">Number</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">data</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">readFloat</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptDefault_Text">soundData</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">writeFloat</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">sample</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptBracket/Brace">}</span> + <span class="ActionScriptBracket/Brace">}</span> + + <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">soundCompleteHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptDefault_Text">isPlaying</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>; + <span class="ActionScriptBracket/Brace">}</span> + + <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">startPlaying</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptDefault_Text">isPlaying</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span> + <span class="ActionScriptDefault_Text">soundData</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">position</span> <span class="ActionScriptOperator">=</span> 0; + <span class="ActionScriptDefault_Text">sound</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Sound</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptDefault_Text">sound</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">SampleDataEvent</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">SAMPLE_DATA</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">sound_sampleDataHandler</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptDefault_Text">channel</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">sound</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">play</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptDefault_Text">channel</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">SOUND_COMPLETE</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">soundCompleteHandler</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptBracket/Brace">}</span> + + <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">sound_sampleDataHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">SampleDataEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptOperator">!</span><span class="ActionScriptDefault_Text">soundData</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">bytesAvailable</span> <span class="ActionScriptOperator">></span> 0<span class="ActionScriptBracket/Brace">)</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptReserved">return</span>; + <span class="ActionScriptBracket/Brace">}</span> + + <span class="ActionScriptReserved">for</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">i</span>:<span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> 0; <span class="ActionScriptDefault_Text">i</span> <span class="ActionScriptOperator"><</span> 8192; <span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">++</span><span class="ActionScriptBracket/Brace">)</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">sample</span>:<span class="ActionScriptDefault_Text">Number</span> <span class="ActionScriptOperator">=</span> 0; + + <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">soundData</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">bytesAvailable</span> <span class="ActionScriptOperator">></span> 0<span class="ActionScriptBracket/Brace">)</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptDefault_Text">sample</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">soundData</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">readFloat</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptBracket/Brace">}</span> + <span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">data</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">writeFloat</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">sample</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">data</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">writeFloat</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">sample</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptBracket/Brace">}</span> + + <span class="ActionScriptBracket/Brace">}</span> + + <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">stopPlaying</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptDefault_Text">channel</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">stop</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptDefault_Text">isPlaying</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>; + <span class="ActionScriptBracket/Brace">}</span> + <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">save</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">docsDir</span>:<span class="ActionScriptDefault_Text">File</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">File</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">documentsDirectory</span>; + <span class="ActionScriptReserved">try</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptDefault_Text">docsDir</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">browseForSave</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"Save As"</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptDefault_Text">docsDir</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">SELECT</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">saveFile</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptBracket/Brace">}</span> + <span class="ActionScriptReserved">catch</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">error</span>:<span class="ActionScriptDefault_Text">Error</span><span class="ActionScriptBracket/Brace">)</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScripttrace">trace</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"Save failed:"</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">error</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">message</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptBracket/Brace">}</span> + + + <span class="ActionScriptBracket/Brace">}</span> + <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">saveFile</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">outputStream</span>:<span class="ActionScriptDefault_Text">FileStream</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">FileStream</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">wavWriter</span>:<span class="ActionScriptDefault_Text">WAVWriter</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">WAVWriter</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">newFile</span>:<span class="ActionScriptDefault_Text">File</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">target</span> <span class="ActionScriptReserved">as</span> <span class="ActionScriptDefault_Text">File</span>; + + <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptOperator">!</span><span class="ActionScriptDefault_Text">newFile</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">exists</span><span class="ActionScriptBracket/Brace">)</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptDefault_Text">soundData</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">position</span> <span class="ActionScriptOperator">=</span> 0; <span class="ActionScriptComment">// rewind to the beginning of the sample +</span> + <span class="ActionScriptDefault_Text">wavWriter</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">numOfChannels</span> <span class="ActionScriptOperator">=</span> 1; <span class="ActionScriptComment">// set the inital properties of the Wave Writer +</span> <span class="ActionScriptDefault_Text">wavWriter</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">sampleBitRate</span> <span class="ActionScriptOperator">=</span> 16; + <span class="ActionScriptDefault_Text">wavWriter</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">samplingRate</span> <span class="ActionScriptOperator">=</span> 44100; + <span class="ActionScriptDefault_Text">outputStream</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">open</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">newFile</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">FileMode</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">WRITE</span><span class="ActionScriptBracket/Brace">)</span>; <span class="ActionScriptComment">//write out our file to disk. +</span> <span class="ActionScriptDefault_Text">wavWriter</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">processSamples</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">outputStream</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">soundData</span><span class="ActionScriptOperator">,</span> 44100<span class="ActionScriptOperator">,</span> 1<span class="ActionScriptBracket/Brace">)</span>; <span class="ActionScriptComment">// convert our ByteArray to a WAV file. +</span> <span class="ActionScriptDefault_Text">outputStream</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">close</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptBracket/Brace">}</span> + <span class="ActionScriptBracket/Brace">}</span> + + <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">toggleRecording</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">isRecording</span><span class="ActionScriptBracket/Brace">)</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptDefault_Text">isRecording</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>; + <span class="ActionScriptDefault_Text">btnRecord</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">label</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">"Record"</span>; + <span class="ActionScriptDefault_Text">stopRecording</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptBracket/Brace">}</span> + <span class="ActionScriptReserved">else</span> + <span class="ActionScriptBracket/Brace">{</span> + <span class="ActionScriptDefault_Text">isRecording</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>; + <span class="ActionScriptDefault_Text">btnRecord</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">label</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">"Stop Recording"</span>; + <span class="ActionScriptDefault_Text">startRecording</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>; + <span class="ActionScriptBracket/Brace">}</span> + <span class="ActionScriptBracket/Brace">}</span> + + <span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">></span> + <span class="MXMLSpecial_Tag"></fx:Script></span> + + <span class="MXMLComponent_Tag"><s:Panel</span><span class="MXMLDefault_Text"> skinClass="</span><span class="MXMLString">skins.TDFPanelSkin</span><span class="MXMLDefault_Text">" width="</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">" height="</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">" title="</span><span class="MXMLString">Microphone Support</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">></span> + <span class="MXMLComponent_Tag"><s:Label</span><span class="MXMLDefault_Text"> left="</span><span class="MXMLString">5</span><span class="MXMLDefault_Text">" top="</span><span class="MXMLString">7</span><span class="MXMLDefault_Text">" width="</span><span class="MXMLString">440</span><span class="MXMLDefault_Text">" verticalAlign="</span><span class="MXMLString">justify</span><span class="MXMLDefault_Text">" color="</span><span class="MXMLString">#323232</span><span class="MXMLDefault_Text">" + text="</span><span class="MXMLString">The new Microphone support allows you to record audio such as voice memo's using a built-in or external mic. The Microphone.names +property will return the list of all available sound input devices found (see init method in code):</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"><s:VGroup</span><span class="MXMLDefault_Text"> top="</span><span class="MXMLString">70</span><span class="MXMLDefault_Text">" horizontalAlign="</span><span class="MXMLString">center</span><span class="MXMLDefault_Text">" horizontalCenter="</span><span class="MXMLString">0</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">></span> + <span class="MXMLComponent_Tag"><s:Label</span><span class="MXMLDefault_Text"> text="</span><span class="MXMLString">Select the microphone input device to use:</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"><s:ComboBox</span><span class="MXMLDefault_Text"> id="</span><span class="MXMLString">cbMicChoices</span><span class="MXMLDefault_Text">" dataProvider="</span><span class="MXMLString">{</span><span class="ActionScriptDefault_Text">microphoneList</span><span class="MXMLString">}</span><span class="MXMLDefault_Text">" selectedIndex="</span><span class="MXMLString">0</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"></s:VGroup></span> + <span class="MXMLComponent_Tag"><s:VGroup</span><span class="MXMLDefault_Text"> top="</span><span class="MXMLString">130</span><span class="MXMLDefault_Text">" horizontalCenter="</span><span class="MXMLString">0</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">></span> + <span class="MXMLComponent_Tag"><s:Label</span><span class="MXMLDefault_Text"> text="</span><span class="MXMLString">Start recording audio by clicking the Record button:</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"><s:HGroup</span><span class="MXMLDefault_Text"> horizontalCenter="</span><span class="MXMLString">0</span><span class="MXMLDefault_Text">" verticalAlign="</span><span class="MXMLString">middle</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">></span> + <span class="MXMLComponent_Tag"><s:Button</span><span class="MXMLDefault_Text"> id="</span><span class="MXMLString">btnRecord</span><span class="MXMLDefault_Text">" label="</span><span class="MXMLString">Record</span><span class="MXMLDefault_Text">" click="</span><span class="ActionScriptDefault_Text">toggleRecording</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">" enabled="</span><span class="MXMLString">{</span><span class="ActionScriptOperator">!</span><span class="ActionScriptDefault_Text">isPlaying</span><span class="MXMLString">}</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"><s:Button</span><span class="MXMLDefault_Text"> id="</span><span class="MXMLString">btnPlay</span><span class="MXMLDefault_Text">" label="</span><span class="MXMLString">Play</span><span class="MXMLDefault_Text">" click="</span><span class="ActionScriptDefault_Text">startPlaying</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">" enabled="</span><span class="MXMLString">{</span><span class="ActionScriptOperator">!</span><span class="ActionScriptDefault_Text">isRecording</span><span class="MXMLString">}</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"><s:Button</span><span class="MXMLDefault_Text"> label="</span><span class="MXMLString">Save Audio Clip</span><span class="MXMLDefault_Text">" click="</span><span class="ActionScriptDefault_Text">save</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">" horizontalCenter="</span><span class="MXMLString">0</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/></span> + <span class="MXMLComponent_Tag"></s:HGroup></span> + <span class="MXMLComponent_Tag"></s:VGroup></span> + <span class="MXMLComponent_Tag"></s:Panel></span> + +<span class="MXMLComponent_Tag"></mx:Module></span></pre></body> +</html>