Skip to content

Commit f96e9ad

Browse files
avm2: Use accessors instead of fields for AccelerometerEvent properties
1 parent 8c9671c commit f96e9ad

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

core/src/avm2/globals/flash/events/AccelerometerEvent.as

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
// It won't be regenerated in the future, so feel free to edit and/or fix
55
package flash.events
66
{
7-
7+
[API("667")]
88
public class AccelerometerEvent extends Event
99
{
1010
// Defines the value of the type property of a AccelerometerEvent event object.
1111
public static const UPDATE:String = "update";
1212

1313
// The number of milliseconds at the time of the event since the runtime was initialized.
14-
public var timestamp:Number;
14+
private var _timestamp:Number;
1515

1616
// Acceleration along the x-axis, measured in Gs.
17-
public var accelerationX:Number;
17+
private var _accelerationX:Number;
1818

1919
// Acceleration along the y-axis, measured in Gs.
20-
public var accelerationY:Number;
20+
private var _accelerationY:Number;
2121

2222
// Acceleration along the z-axis, measured in Gs.
23-
public var accelerationZ:Number;
23+
private var _accelerationZ:Number;
2424

2525
public function AccelerometerEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, timestamp:Number = 0,
2626
accelerationX:Number = 0, accelerationY:Number = 0, accelerationZ:Number = 0)
@@ -32,6 +32,34 @@ package flash.events
3232
this.accelerationZ = accelerationZ;
3333
}
3434

35+
public function get timestamp():Number {
36+
return this._timestamp;
37+
}
38+
public function set timestamp(value:Number):void {
39+
this._timestamp = value;
40+
}
41+
42+
public function get accelerationX():Number {
43+
return this._accelerationX;
44+
}
45+
public function set accelerationX(value:Number):void {
46+
this._accelerationX = value;
47+
}
48+
49+
public function get accelerationY():Number {
50+
return this._accelerationY;
51+
}
52+
public function set accelerationY(value:Number):void {
53+
this._accelerationY = value;
54+
}
55+
56+
public function get accelerationZ():Number {
57+
return this._accelerationZ;
58+
}
59+
public function set accelerationZ(value:Number):void {
60+
this._accelerationZ = value;
61+
}
62+
3563
// Creates a copy of an AccelerometerEvent object and sets the value of each property to match that of the original.
3664
override public function clone():Event
3765
{

0 commit comments

Comments
 (0)