PageRenderTime 27ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/frameworks/projects/playerglobal/bundles/ru_RU/docs/flash.sensors.xml

https://github.com/adufilie/flex-sdk
XML | 279 lines | 218 code | 43 blank | 18 comment | 0 complexity | f8d04e0f81ee0eab2fdc44e6b7a79ea1 MD5 | raw file
Possible License(s): Apache-2.0

Large files files are truncated, but you can click here to view the full file

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <apiPackage xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" id="flash.sensors" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiPackage/apiPackage "><apiName class="- topic/title reference/title apiRef/apiName ">flash.sensors</apiName><apiDetail class="- topic/body reference/refbody apiRef/apiDetail "/><apiClassifier languages="" id="flash.sensors:Accelerometer" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">Accelerometer</apiName><shortdesc class="- topic/shortdesc ">
  17. Класс Accelerometer отправляет события на основании активности, обнаруживаемой датчиком движения устройства.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Класс Accelerometer
  18. </apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  19. Класс Accelerometer отправляет события на основании активности, обнаруживаемой датчиком движения устройства. Эти данные представляют местоположение устройства или движение вдоль трехмерной оси. Когда устройство перемещается, датчик распознает движение и возвращает данные об ускорении. Класс Accelerometer предоставляет методы, позволяющие сделать запрос, поддерживается ли акселерометр, а также установить частоту отправки событий ускорения.
  20. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Примечание.</b> Проверьте свойство <codeph class="+ topic/ph pr-d/codeph ">Accelerometer.isSupported</codeph>, чтобы узнать, поддерживает ли текущая платформа среды выполнения использование этой функции. Хотя класс Accelerometer и его элементы доступны для версий среды выполнения, перечисленных для каждой записи API, доступность данной функции определяется текущей платформой среды выполнения. Например, можно скомпилировать код с использованием свойств класса Accelerometer для Flash Player 10.1, но необходимо проверить свойство <codeph class="+ topic/ph pr-d/codeph ">Accelerometer.isSupported</codeph>, чтобы проверить доступность класса Accelerometer на текущей платформе, в которой развернута среда выполнения Flash Player. Если свойство <codeph class="+ topic/ph pr-d/codeph ">Accelerometer.isSupported</codeph> возвращает значение <codeph class="+ topic/ph pr-d/codeph ">true</codeph> во время выполнения, то текущая платформа поддерживает класс Accelerometer.</p>
  21. <p class="- topic/p "><i class="+ topic/ph hi-d/i ">Поддержка в профилях AIR:</i> эта функция поддерживается только на мобильных устройствах. Она не поддерживается на компьютерах или в среде AIR для телевизионных устройств. Дополнительные сведения о поддержке API-интерфейса в разных профилях см. в разделе «<xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">Поддержка в профилях AIR</xref>».
  22. </p>
  23. </apiDesc><example conref="examples\AccelerometerExample.as" class="- topic/example "> В следующем примере приложение перемещает объект Sprite в зависимости от событий <codeph class="+ topic/ph pr-d/codeph ">update</codeph> акселерометра. События <codeph class="+ topic/ph pr-d/codeph ">update</codeph> акселерометра указывают на перемещение устройства.
  24. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  25. package
  26. {
  27. import flash.display.Sprite;
  28. import flash.display.StageAlign;
  29. import flash.display.StageScaleMode;
  30. import flash.events.Event;
  31. import flash.events.AccelerometerEvent;
  32. import flash.sensors.Accelerometer;
  33. public class AccelerometerTest extends Sprite
  34. {
  35. private var ball:Sprite;
  36. private var accelerometer:Accelerometer;
  37. private var xSpeed:Number = 0;
  38. private var ySpeed:Number = 0;
  39. private const RADIUS = 20;
  40. public final function AccelerometerTest()
  41. {
  42. stage.scaleMode = StageScaleMode.NO_SCALE;
  43. stage.align = StageAlign.TOP_LEFT;
  44. createBall();
  45. if (Accelerometer.isSupported)
  46. {
  47. accelerometer = new Accelerometer();
  48. accelerometer.addEventListener(AccelerometerEvent.UPDATE, accUpdateHandler);
  49. stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
  50. }
  51. }
  52. private final function createBall():void
  53. {
  54. ball = new Sprite();
  55. ball.graphics.beginFill(0xFF0000);
  56. ball.graphics.drawCircle(0, 0, RADIUS);
  57. ball.cacheAsBitmap = true;
  58. ball.x = stage.stageWidth / 2;
  59. ball.y = stage.stageHeight / 2;
  60. addChild(ball);
  61. }
  62. private final function enterFrameHandler(event:Event):void
  63. {
  64. event.stopPropagation();
  65. moveBall();
  66. }
  67. private final function moveBall():void
  68. {
  69. var newX:Number = ball.x + xSpeed;
  70. var newY:Number = ball.y + ySpeed;
  71. if (newX &lt; 20)
  72. {
  73. ball.x = RADIUS;
  74. xSpeed = 0;
  75. }
  76. else if (newX > stage.stageWidth - RADIUS)
  77. {
  78. ball.x = stage.stageWidth - RADIUS;
  79. xSpeed = 0;
  80. }
  81. else
  82. {
  83. ball.x += xSpeed;
  84. }
  85. if (newY &lt; RADIUS)
  86. {
  87. ball.y = RADIUS;
  88. ySpeed = 0;
  89. }
  90. else if (newY > stage.stageHeight - RADIUS)
  91. {
  92. ball.y = stage.stageHeight - RADIUS;
  93. ySpeed = 0;
  94. }
  95. else
  96. {
  97. ball.y += ySpeed;
  98. }
  99. }
  100. private final function accUpdateHandler(event:AccelerometerEvent):void
  101. {
  102. xSpeed -= event.accelerationX * 2;
  103. ySpeed += event.accelerationY * 2;
  104. }
  105. }
  106. }
  107. </codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.sensors.xml#Accelerometer/isSupported" class="- topic/link "><linktext class="- topic/linktext ">isSupported</linktext></link><link href="flash.events.xml#AccelerometerEvent" class="- topic/link "><linktext class="- topic/linktext ">flash.events.AccelerometerEvent</linktext></link><link href="http://www.riagora.com/2010/04/air-and-the-accelerometer/" class="- topic/link "><linktext class="- topic/linktext ">Микаэль Шез (Michael Chaize): AIR и акселерометр</linktext></link><link href="http://www.riagora.com/2010/05/become-an-air-pilot/" class="- topic/link "><linktext class="- topic/linktext ">Микаэль Шез (Michael Chaize): Управление средой AIR </linktext></link></related-links><adobeApiEvent id="flash.sensors:Accelerometer_flash.events.StatusEvent.STATUS_status" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">status</apiName><shortdesc class="- topic/shortdesc ">
  108. Отправляется, когда акселерометр изменяет свое состояние.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.StatusEvent.STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.StatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  109. Отправляется, когда акселерометр изменяет свое состояние.
  110. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Примечание.</b> На некоторых устройствах акселерометр всегда доступен. На таких устройствах объект Accelerometer никогда не отправляет событие <codeph class="+ topic/ph pr-d/codeph ">status</codeph>.</p>
  111. </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.sensors:Accelerometer_flash.events.AccelerometerEvent.UPDATE_update" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">update</apiName><shortdesc class="- topic/shortdesc ">
  112. Событие update отправляется в ответ на получение обновлений от датчика акселерометра.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.AccelerometerEvent.UPDATE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.AccelerometerEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  113. Событие <codeph class="+ topic/ph pr-d/codeph ">update</codeph> отправляется в ответ на получение обновлений от датчика акселерометра. Это событие отправляется при следующих обстоятельствах:
  114. <p class="- topic/p "><ul class="- topic/ul "><li class="- topic/li ">когда добавляется новая функция прослушивателя с помощью метода <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph>, это событие отправляется один раз всем зарегистрированным прослушивателям для того, чтобы передать текущее значение акселерометра;</li><li class="- topic/li ">каждый раз при получении обновлений акселерометра от платформы через установленные устройством интервалы;</li><li class="- topic/li ">каждый раз, когда приложение пропускает изменение показаний акселерометра (например, когда среда выполнения восстанавливается после режима ожидания).</li></ul></p>
  115. </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.sensors:Accelerometer:Accelerometer" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">Accelerometer</apiName><shortdesc class="- topic/shortdesc ">
  116. Создает новый экземпляр Accelerometer.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  117. Создает новый экземпляр Accelerometer.
  118. </apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.sensors:Accelerometer:setRequestedUpdateInterval" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">setRequestedUpdateInterval</apiName><shortdesc class="- topic/shortdesc ">
  119. Для установки требуемых интервалов обновления служит метод setRequestedUpdateInterval.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">Значение свойства <codeph class="+ topic/ph pr-d/codeph ">interval</codeph> меньше нуля.
  120. </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">interval</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">Требуемый интервал обновления. Если для <codeph class="+ topic/ph pr-d/codeph ">interval</codeph> установлено значение 0, используется минимальный поддерживаемый интервал обновления.
  121. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  122. Для установки требуемых интервалов обновления служит метод <codeph class="+ topic/ph pr-d/codeph ">setRequestedUpdateInterval</codeph>. Интервал времени измеряется в миллисекундах. Интервал обновления предназначен только в качестве ориентира для экономии заряда аккумулятора. Фактическое время между обновлениями акселерометра может быть больше или меньше этого значения. Любое изменение в интервале обновления затрагивает все зарегистрированные прослушиватели. Класс Accelerometer можно использовать, не вызывая метод <codeph class="+ topic/ph pr-d/codeph ">setRequestedUpdateInterval()</codeph>. В этом случае, приложение получает обновления с интервалом, используемым устройством по умолчанию.
  123. </apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.sensors:Accelerometer:isSupported:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">isSupported</apiName><shortdesc class="- topic/shortdesc ">
  124. Свойство isSupported имеет значение true, если датчик акселерометра доступен на устройстве, в противном случае оно имеет значение false.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  125. Свойство <codeph class="+ topic/ph pr-d/codeph ">isSupported</codeph> имеет значение <codeph class="+ topic/ph pr-d/codeph ">true</codeph>, если датчик акселерометра доступен на устройстве, в противном случае оно имеет значение <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.
  126. </apiDesc><example conref="examples\Accelerometer_isSupported.as" class="- topic/example "> В следующем примере используется свойство <codeph class="+ topic/ph pr-d/codeph ">Accelerometer.isSupported</codeph>, чтобы проверить наличие поддержки класса Accelerometer во время выполнения. Если текущая платформа поддерживает возможности класса Accelerometer, то для объекта Accelerometer добавляется прослушиватель событий, и связанный с ним обработчик вводит в текстовое поле метку времени и значения ускорения. В противном случае в текстовом поле появляется сообщение о том, что текущая среда не поддерживает данную функцию.
  127. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  128. var myTextField:TextField = new TextField();
  129. myTextField.width = 200;
  130. addChild(myTextField);
  131. var acc1:Accelerometer = new Accelerometer();
  132. var isSupported:Boolean = Accelerometer.isSupported;
  133. checksupport();
  134. function checksupport():void {
  135. if (isSupported) {
  136. myTextField.text = "Accelerometer feature supported";
  137. acc1.addEventListener(AccelerometerEvent.UPDATE, updateHandler);
  138. } else {
  139. myTextField.text = "Accelerometer feature not supported";
  140. }
  141. }
  142. function updateHandler(evt:AccelerometerEvent):void {
  143. myTextField.text = String("at: " + evt.timestamp + "\n" + "acceleration X: " + evt.accelerationX + "\n" + "acceleration Y: " + evt.accelerationY + "\n" + "acceleration Z: " + evt.accelerationZ);
  144. }
  145. </codeblock></example></apiValueDetail></apiValue><apiValue id="flash.sensors:Accelerometer:muted:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">muted</apiName><shortdesc class="- topic/shortdesc ">
  146. Указывает, запретил ли пользователь доступ к акселерометру: нет доступа (true), или доступ разрешен (false).</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">Accelerometer, Accelerometer.muted, muted
  147. </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  148. Указывает, запретил ли пользователь доступ к акселерометру: нет доступа (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>), или доступ разрешен (<codeph class="+ topic/ph pr-d/codeph ">false</codeph>). При изменении этого значения отправляется событие <codeph class="+ topic/ph pr-d/codeph ">status</codeph>.
  149. </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.sensors.xml#Accelerometer/event:status" class="- topic/link "><linktext class="- topic/linktext ">status</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.sensors:Geolocation" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">Geolocation</apiName><shortdesc class="- topic/shortdesc ">
  150. Класс Geolocation отправляет события в ответ на датчик местоположения устройства.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  151. Класс Geolocation отправляет события в ответ на датчик местоположения устройства.
  152. <p class="- topic/p ">Если устройство поддерживает определение географического положения, этот класс можно использовать для получения данных о местоположении устройства. Географическое местоположение отображается на устройстве в виде координат широты и долготы (в стандартном формате WGS-84). Когда местоположение устройства меняется, отправляются обновления. Если устройство поддерживает такую функцию, можно получать сведения о высотной отметке, точности, направлении, скорости и метке времени последнего изменения местоположения.</p>
  153. <p class="- topic/p "><i class="+ topic/ph hi-d/i ">Поддержка в профилях AIR:</i> эта функция поддерживается только на мобильных устройствах. Она не поддерживается на компьютерах или в среде AIR для телевизионных устройств. Используйте свойство <codeph class="+ topic/ph pr-d/codeph ">Geolocation.isSupported</codeph>, чтобы проверить наличие поддержки в cреде выполнения. Дополнительные сведения о поддержке API-интерфейса в разных профилях см. в разделе «<xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">Поддержка в профилях AIR</xref>».
  154. </p>
  155. </apiDesc><example conref="examples\GeolocationExample.as" class="- topic/example "> В следующем примере приложение отображает широту, долготу и горизонтальную погрешность событий <codeph class="+ topic/ph pr-d/codeph ">update</codeph> класса GeoLocation по мере их поступления.
  156. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  157. package
  158. {
  159. import flash.display.Sprite;
  160. import flash.display.StageAlign;
  161. import flash.display.StageScaleMode;
  162. import flash.events.GeolocationEvent;
  163. import flash.sensors.Geolocation;
  164. import flash.text.TextField;
  165. import flash.text.TextFormat;
  166. public class GeolocationTest extends Sprite
  167. {
  168. private var geo:Geolocation;
  169. private var log:TextField;
  170. public function GeolocationTest()
  171. {
  172. stage.scaleMode = StageScaleMode.NO_SCALE;
  173. stage.align = StageAlign.TOP_LEFT;
  174. setUpTextField();
  175. if (Geolocation.isSupported)
  176. {
  177. geo = new Geolocation();
  178. geo.setRequestedUpdateInterval(100);
  179. geo.addEventListener(GeolocationEvent.UPDATE, geolocationUpdateHandler);
  180. }
  181. else
  182. {
  183. log.text = "No geolocation support.";
  184. }
  185. }
  186. private function geolocationUpdateHandler(event:GeolocationEvent):void
  187. {
  188. log.text = "latitude:" + event.latitude.toString() + "°\n";
  189. log.appendText("longitude:" + event.longitude.toString() + "°\n");
  190. log.appendText("horizontal accuracy:" + event.horizontalAccuracy.toString() + " m");
  191. }
  192. private function setUpTextField():void
  193. {
  194. log = new TextField();
  195. var format:TextFormat = new TextFormat("_sans", 24);
  196. log.defaultTextFormat = format;
  197. log.border = true;
  198. log.wordWrap = true;
  199. log.multiline = true;
  200. log.x = 10;
  201. log.y = 10;
  202. log.height = stage.stageHeight - 20;
  203. log.width = stage.stageWidth - 20;
  204. addChild(log);
  205. }
  206. }
  207. }
  208. </codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="http://coenraets.org/blog/2010/08/multi-user-google-map-collaboration-on-android/" class="- topic/link "><linktext class="- topic/linktext ">Кристоф Конрац (Cristophe Coenraets): Совместная работа с Картами Google в многопользовательской среде</linktext></link></related-links><adobeApiEvent id="flash.sensors:Geolocation_flash.events.StatusEvent.STATUS_status" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">status</apiName><shortdesc class="- topic/shortdesc ">
  209. Объект Geolocation отправляет события status, когда пользователь изменяет доступ к датчику местоположения.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.StatusEvent.STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.StatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  210. Объект Geolocation отправляет события <codeph class="+ topic/ph pr-d/codeph ">status</codeph>, когда пользователь изменяет доступ к датчику местоположения. Например, если в ответ на запрос устройства пользователь запрещает приложению обращаться к данным о местоположении, объект Geolocation отправляет событие <codeph class="+ topic/ph pr-d/codeph ">status</codeph>. Когда состояние изменяется таким образом, что датчик местоположения становится недоступным, свойство <codeph class="+ topic/ph pr-d/codeph ">muted</codeph> экземпляра Geolocation имеет значение <codeph class="+ topic/ph pr-d/codeph ">true</codeph>.
  211. </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.sensors.xml#Geolocation/muted" class="- topic/link "><linktext class="- topic/linktext ">muted</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.sensors:Geolocation_flash.events.GeolocationEvent.UPDATE_update" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">update</apiName><shortdesc class="- topic/shortdesc ">
  212. Событие update отправляется в ответ на получение обновлений от датчика местоположения.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.GeolocationEvent.UPDATE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.GeolocationEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  213. Событие <codeph class="+ topic/ph pr-d/codeph ">update</codeph> отправляется в ответ на получение обновлений от датчика местоположения. Это событие отправляется при следующих обстоятельствах:
  214. <p class="- topic/p "><ul class="- topic/ul "><li class="- topic/li ">когда добавляется новая функция прослушивателя с помощью метода <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph>, это событие отправляется один раз всем зарегистрированным прослушивателям для того, чтобы передать текущее значение датчика местоположения;</li><li class="- topic/li ">каждый раз при получении обновлений датчика местоположения от платформы через установленные устройством интервалы;</li><li class="- topic/li ">каждый раз, когда приложение пропускает изменение местоположения (например, когда приложение восстанавливается после спящего режима).</li></ul></p>
  215. <p class="- topic/p "><i class="+ topic/ph hi-d/i ">Примечание.</i> Устройства iPhone первого поколения, которые не оснащены модулем GPS, отправляют события <codeph class="+ topic/ph pr-d/codeph ">update</codeph> только в редких случаях. На этих устройствах объект Geolocation сначала отправляет одно или два события <codeph class="+ topic/ph pr-d/codeph ">update</codeph>. После этого он отправляет события <codeph class="+ topic/ph pr-d/codeph ">update</codeph> в случае заметного изменения информации.</p>
  216. </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.sensors:Geolocation:Geolocation" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">Geolocation</apiName><shortdesc class="- topic/shortdesc ">
  217. Создает новый экземпляр Geolocation.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  218. Создает новый экземпляр Geolocation.
  219. </apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.sensors:Geolocation:setRequestedUpdateInterval" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">setRequestedUpdateInterval</apiName><shortdesc class="- topic/shortdesc ">
  220. Служит для указания интервала обновлений в миллисекундах.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">Значение свойства <codeph class="+ topic/ph pr-d/codeph ">interval</codeph> меньше нуля.
  221. </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">interval</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">запрошенный интервал обновления. Если <codeph class="+ topic/ph pr-d/codeph ">interval</codeph> &lt;= 0, вызов этого метода игнорируется.
  222. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  223. Служит для указания интервала обновлений в миллисекундах. Интервал обновления предназначен только в качестве ориентира для экономии заряда аккумулятора. Фактическое время между обновлениями датчика местоположения может быть больше или меньше этого значения. Любое изменение интервала обновления с помощью этого метода затрагивает все зарегистрированные прослушиватели события <codeph class="+ topic/ph pr-d/codeph ">update</codeph>. Класс Geolocation можно использовать, не вызывая метод <codeph class="+ topic/ph pr-d/codeph ">setRequestedUpdateInterval()</codeph>. В этом случае платформа будет передавать обновления с учетом собственного интервала по умолчанию.
  224. <p class="- topic/p "><i class="+ topic/ph hi-d/i ">Примечание.</i> Устройства iPhone первого поколения, которые не оснащены модулем GPS, отправляют события <codeph class="+ topic/ph pr-d/codeph ">update</codeph> только в редких случаях. На этих устройствах объект Geolocation сначала отправляет одно или два события <codeph class="+ topic/ph pr-d/codeph ">update</codeph>. После этого он отправляет события <codeph class="+ topic/ph pr-d/codeph ">update</codeph> в случае заметного изменения информации.</p>
  225. </apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.sensors:Geolocation:isSupported:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">isSupported</apiName><shortdesc class="- topic/shortdesc ">
  226. Указывает, доступен ли датчик местоположения на устройстве (true); в противном случае имеет значение false.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d…

Large files files are truncated, but you can click here to view the full file