/frameworks/projects/playerglobal/bundles/en_US/docs/flash.sensors.xml
XML | 344 lines | 283 code | 43 blank | 18 comment | 0 complexity | fb4cdba72a15ba92c9633361248498f3 MD5 | raw file
Possible License(s): Apache-2.0
- <?xml version="1.0" encoding="UTF-8"?><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 ">
- <!--
- 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.
- -->
- The Accelerometer class dispatches events based on activity detected by the device's motion sensor.</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 class
-
- </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 ">
- The Accelerometer class dispatches events based on activity detected by the device's motion sensor.
- This data represents the device's location or
- movement along a 3-dimensional axis. When the device moves, the sensor detects this movement and
- returns acceleration data. The Accelerometer class provides methods to query whether or not
- accelerometer is supported, and also to set the rate at which acceleration events are dispatched.
- <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> Use the <codeph class="+ topic/ph pr-d/codeph ">Accelerometer.isSupported</codeph> property to test the runtime environment for the ability
- to use this feature. While the Accelerometer class and its members are accessible to the Runtime Versions listed for
- each API entry, the current environment for the runtime determines the availability of this feature. For example, you can
- compile code using the Accelerometer class properties for Flash Player 10.1, but you need to use the <codeph class="+ topic/ph pr-d/codeph ">Accelerometer.isSupported</codeph>
- property to test for the availability of the Accelerometer feature in the current deployment environment for the Flash Player runtime. If
- <codeph class="+ topic/ph pr-d/codeph ">Accelerometer.isSupported</codeph> is <codeph class="+ topic/ph pr-d/codeph ">true</codeph> at runtime, then Accelerometer support currently exists.</p>
-
- <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR profile support:</i> This feature is supported
- only on mobile devices. It is not supported on desktop or AIR for TV devices. See
- <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">
- AIR Profile Support</xref> for more information regarding API support across multiple profiles.
- </p>
-
- </apiDesc><example conref="examples\AccelerometerExample.as" class="- topic/example "> In the following example, the application moves a Sprite
- based on accelerometer <codeph class="+ topic/ph pr-d/codeph ">update</codeph> events. The accelerometer
- <codeph class="+ topic/ph pr-d/codeph ">update</codeph> events indicate movement of the device.
- <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
- package
- {
- import flash.display.Sprite;
- import flash.display.StageAlign;
- import flash.display.StageScaleMode;
- import flash.events.Event;
- import flash.events.AccelerometerEvent;
- import flash.sensors.Accelerometer;
- public class AccelerometerTest extends Sprite
- {
- private var ball:Sprite;
- private var accelerometer:Accelerometer;
- private var xSpeed:Number = 0;
- private var ySpeed:Number = 0;
- private const RADIUS = 20;
-
- public final function AccelerometerTest()
- {
- stage.scaleMode = StageScaleMode.NO_SCALE;
- stage.align = StageAlign.TOP_LEFT;
-
- createBall();
-
- if (Accelerometer.isSupported)
- {
- accelerometer = new Accelerometer();
- accelerometer.addEventListener(AccelerometerEvent.UPDATE, accUpdateHandler);
- stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
- }
- }
-
- private final function createBall():void
- {
- ball = new Sprite();
- ball.graphics.beginFill(0xFF0000);
- ball.graphics.drawCircle(0, 0, RADIUS);
- ball.cacheAsBitmap = true;
- ball.x = stage.stageWidth / 2;
- ball.y = stage.stageHeight / 2;
- addChild(ball);
- }
- private final function enterFrameHandler(event:Event):void
- {
- event.stopPropagation();
- moveBall();
- }
- private final function moveBall():void
- {
- var newX:Number = ball.x + xSpeed;
- var newY:Number = ball.y + ySpeed;
- if (newX < 20)
- {
- ball.x = RADIUS;
- xSpeed = 0;
- }
- else if (newX > stage.stageWidth - RADIUS)
- {
- ball.x = stage.stageWidth - RADIUS;
- xSpeed = 0;
- }
- else
- {
- ball.x += xSpeed;
- }
-
- if (newY < RADIUS)
- {
- ball.y = RADIUS;
- ySpeed = 0;
- }
- else if (newY > stage.stageHeight - RADIUS)
- {
- ball.y = stage.stageHeight - RADIUS;
- ySpeed = 0;
- }
- else
- {
- ball.y += ySpeed;
- }
- }
- private final function accUpdateHandler(event:AccelerometerEvent):void
- {
- xSpeed -= event.accelerationX * 2;
- ySpeed += event.accelerationY * 2;
- }
- }
- }
- </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 and the Accelerometer</linktext></link><link href="http://www.riagora.com/2010/05/become-an-air-pilot/" class="- topic/link "><linktext class="- topic/linktext ">Michael Chaize: Become an AIR Pilot</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 ">
- Dispatched when an accelerometer changes its 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="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 ">
- Dispatched when an accelerometer changes its status.
-
- <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> On some devices, the accelerometer is always available.
- On such devices, an Accelerometer object never dispatches a <codeph class="+ topic/ph pr-d/codeph ">status</codeph>
- event.</p>
-
- </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 ">
- The update event is dispatched in response to updates from the accelerometer sensor.</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 ">
- The <codeph class="+ topic/ph pr-d/codeph ">update</codeph> event is dispatched in response to updates from the accelerometer sensor.
- The event is dispatched in the following circumstances:
-
- <p class="- topic/p "><ul class="- topic/ul "><li class="- topic/li ">When a new listener function is attached through <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph>, this event is
- delivered once to all the registered listeners for providing the current value of the accelerometer.</li><li class="- topic/li ">Whenever accelerometer updates are obtained from the platform at device determined intervals.</li><li class="- topic/li ">Whenever the application misses a change in the accelerometer (for example, the runtime
- is resuming after being idle).</li></ul></p>
-
- </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 ">
- Creates a new Accelerometer instance.</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 ">
- Creates a new Accelerometer instance.
-
- </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 ">
- The setRequestedUpdateInterval method is used to set the desired time interval
- for updates.</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 ">The specified <codeph class="+ topic/ph pr-d/codeph ">interval</codeph> is less than zero.
-
- </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 ">The requested update interval. If <codeph class="+ topic/ph pr-d/codeph ">interval</codeph> is set to 0, then the minimum supported update interval is used.
-
-
- </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
- The <codeph class="+ topic/ph pr-d/codeph ">setRequestedUpdateInterval</codeph> method is used to set the desired time interval
- for updates. The time interval is measured in milliseconds. The update interval is only used as a
- hint to conserve the battery power. The actual time between acceleration updates may be greater
- or lesser than this value. Any change in the update interval affects all registered listeners.
- You can use the Accelerometer class without calling the <codeph class="+ topic/ph pr-d/codeph ">setRequestedUpdateInterval()</codeph>
- method. In this case, the application receives updates based on the device's default interval.
-
- </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 ">
- The isSupported property is set to true if the accelerometer sensor is
- available on the device, otherwise it is set to 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 ">
- The <codeph class="+ topic/ph pr-d/codeph ">isSupported</codeph> property is set to <codeph class="+ topic/ph pr-d/codeph ">true</codeph> if the accelerometer sensor is
- available on the device, otherwise it is set to <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.
-
- </apiDesc><example conref="examples\Accelerometer_isSupported.as" class="- topic/example "> The following example uses the <codeph class="+ topic/ph pr-d/codeph ">Accelerometer.isSupported</codeph> property to test for Accelerometer support at runtime.
- If the current environment supports the Accelerometer feature, then an event listener is added to the Accelerometer object, and the associated handler
- populates the text field with the timestamp and acceleration values. Otherwise, the text field indicates that the feature is not supported in the current
- environment.
- <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
- var myTextField:TextField = new TextField();
- myTextField.width = 200;
- addChild(myTextField);
- var acc1:Accelerometer = new Accelerometer();
- var isSupported:Boolean = Accelerometer.isSupported;
- checksupport();
- function checksupport():void {
- if (isSupported) {
- myTextField.text = "Accelerometer feature supported";
- acc1.addEventListener(AccelerometerEvent.UPDATE, updateHandler);
- } else {
- myTextField.text = "Accelerometer feature not supported";
- }
- }
- function updateHandler(evt:AccelerometerEvent):void {
- myTextField.text = String("at: " + evt.timestamp + "\n" + "acceleration X: " + evt.accelerationX + "\n" + "acceleration Y: " + evt.accelerationY + "\n" + "acceleration Z: " + evt.accelerationZ);
- }
- </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 ">
- Specifies whether the user has denied access to the accelerometer (true)
- or allowed access (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
- </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 ">
- Specifies whether the user has denied access to the accelerometer (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>)
- or allowed access (<codeph class="+ topic/ph pr-d/codeph ">false</codeph>). When this value changes,
- a <codeph class="+ topic/ph pr-d/codeph ">status</codeph> event is dispatched.
-
- </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 ">
- The Geolocation class dispatches events in response to the device's location sensor.</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 ">
- The Geolocation class dispatches events in response to the device's location sensor.
-
- <p class="- topic/p ">If a device supports geolocation, you can use this class to obtain the current geographical
- location of the device. The geographical location is displayed on the device in the form of latitudinal
- and longitudinal coordinates (in WGS-84 standard format). When the location of the device changes,
- you can receive updates about the changes. If the device supports this feature, you will be able to obtain
- information about the altitude, accuracy, heading, speed, and timestamp of the latest change in the location.</p>
-
- <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR profile support:</i> This feature is supported
- only on mobile devices. It is not supported on desktop or AIR for TV devices. You can test
- for support at run time using the <codeph class="+ topic/ph pr-d/codeph ">Geolocation.isSupported</codeph> property. See
- <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">
- AIR Profile Support</xref> for more information regarding API support across multiple profiles.
- </p>
-
- </apiDesc><example conref="examples\GeolocationExample.as" class="- topic/example "> In the following example, the application displays the latitude,
- longitude, and horizontal accuracy of geolocation <codeph class="+ topic/ph pr-d/codeph ">update</codeph> events
- as they are received.
- <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
- package
- {
- import flash.display.Sprite;
- import flash.display.StageAlign;
- import flash.display.StageScaleMode;
- import flash.events.GeolocationEvent;
- import flash.sensors.Geolocation;
- import flash.text.TextField;
- import flash.text.TextFormat;
- public class GeolocationTest extends Sprite
- {
- private var geo:Geolocation;
- private var log:TextField;
-
- public function GeolocationTest()
- {
- stage.scaleMode = StageScaleMode.NO_SCALE;
- stage.align = StageAlign.TOP_LEFT;
- setUpTextField();
-
- if (Geolocation.isSupported)
- {
- geo = new Geolocation();
- geo.setRequestedUpdateInterval(100);
- geo.addEventListener(GeolocationEvent.UPDATE, geolocationUpdateHandler);
- }
- else
- {
- log.text = "No geolocation support.";
- }
- }
-
- private function geolocationUpdateHandler(event:GeolocationEvent):void
- {
- log.text = "latitude:" + event.latitude.toString() + "°\n";
- log.appendText("longitude:" + event.longitude.toString() + "°\n");
- log.appendText("horizontal accuracy:" + event.horizontalAccuracy.toString() + " m");
- }
- private function setUpTextField():void
- {
- log = new TextField();
- var format:TextFormat = new TextFormat("_sans", 24);
- log.defaultTextFormat = format;
- log.border = true;
- log.wordWrap = true;
- log.multiline = true;
- log.x = 10;
- log.y = 10;
- log.height = stage.stageHeight - 20;
- log.width = stage.stageWidth - 20;
- addChild(log);
- }
- }
- }
- </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: Mulit-user Google Maps Collaboration</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 ">
- The Geolocation object dispatches status events when the user changes access
- to the location sensor.</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 ">
- The Geolocation object dispatches <codeph class="+ topic/ph pr-d/codeph ">status</codeph> events when the user changes access
- to the location sensor. For example, if, in response to a device prompt, the user prevents the
- application from accessing location data, the Geolcation object dispatches a <codeph class="+ topic/ph pr-d/codeph ">status</codeph>
- event. When the status changes to a state where the location sensor is not available, the
- <codeph class="+ topic/ph pr-d/codeph ">muted</codeph> property of the Geolocation instance is <codeph class="+ topic/ph pr-d/codeph ">true</codeph>.
-
- </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 ">
- The update event is dispatched in response to updates from the location sensor.</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 ">
- The <codeph class="+ topic/ph pr-d/codeph ">update</codeph> event is dispatched in response to updates from the location sensor. The event
- is dispatched under the following circumstances:
-
- <p class="- topic/p "><ul class="- topic/ul "><li class="- topic/li ">When a new listener function is attached through <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph>, this event is
- delivered once to all the registered listeners to provide the current value of the location.</li><li class="- topic/li ">Whenever location updates are obtained from the platform at device determined intervals.</li><li class="- topic/li ">Whenever the application misses a change in the location (for example, the application is waking up
- after being asleep).</li></ul></p>
-
- <p class="- topic/p "><i class="+ topic/ph hi-d/i ">Note:</i> First-generation iPhones, which do not include a GPS unit, dispatch
- <codeph class="+ topic/ph pr-d/codeph ">update</codeph> events only occasionally. On these devices, a Geolocation object initially
- dispatches one or two <codeph class="+ topic/ph pr-d/codeph ">update</codeph> events. It then dispatches <codeph class="+ topic/ph pr-d/codeph ">update</codeph> events
- when information changes noticeably.</p>
-
- </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 ">
- Creates a new Geolocation instance.</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 ">
- Creates a new Geolocation instance.
-
- </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 ">
- Used to set the time interval for updates, in milliseconds.</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 ">The specified <codeph class="+ topic/ph pr-d/codeph ">interval</codeph> is less than zero.
-
- </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 ">requested update interval. If <codeph class="+ topic/ph pr-d/codeph ">interval</codeph> <= 0, then any call to this method
- has no effect.
-
- </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
- Used to set the time interval for updates, in milliseconds. The update interval is only used as a
- hint to conserve the battery power. The actual time between location updates may be greater or
- lesser than this value.Any change in the update interval using this method
- affects all registered <codeph class="+ topic/ph pr-d/codeph ">update</codeph> event listeners. The Geolocation class
- can be used without calling the <codeph class="+ topic/ph pr-d/codeph ">setRequestedUpdateInterval</codeph> method.
- In this case, the platform will return updates based on its default interval.
-
- <p class="- topic/p "><i class="+ topic/ph hi-d/i ">Note:</i> First-generation iPhones, which do not include a GPS unit, dispatch
- <codeph class="+ topic/ph pr-d/codeph ">update</codeph> events only occasionally. On these devices, a Geolocation object initially
- dispatches one or two <codeph class="+ topic/ph pr-d/codeph ">update</codeph> events. It then dispatches <codeph class="+ topic/ph pr-d/codeph ">update</codeph> events
- when information changes noticeably.</p>
-
- </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 ">
- Whether a location sensor is available on the device (true); otherwise 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/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 ">
- Whether a location sensor is available on the device (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>); otherwise <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.
-
- </apiDesc></apiValueDetail></apiValue><apiValue id="flash.sensors:Geolocation: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 ">
- Specifies whether the user has denied access to the geolocation (true)
- or allowed access (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 "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">Geolocation, Geolocation.muted, muted
- </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 ">
- Specifies whether the user has denied access to the geolocation (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>)
- or allowed access (<codeph class="+ topic/ph pr-d/codeph ">false</codeph>). When this value changes,
- a <codeph class="+ topic/ph pr-d/codeph ">status</codeph> event is dispatched.
-
- </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.sensors.xml#Geolocation/event:status" class="- topic/link "><linktext class="- topic/linktext ">status</linktext></link></related-links></apiValue></apiClassifier></apiPackage>