Skip to content

Commit abaf19c

Browse files
avm2: Use accessors instead of fields for FocusEvent properties
1 parent 55f849d commit abaf19c

File tree

1 file changed

+44
-7
lines changed

1 file changed

+44
-7
lines changed

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

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,19 @@ package flash.events
2222
public static const MOUSE_FOCUS_CHANGE:String = "mouseFocusChange";
2323

2424
// A reference to the complementary InteractiveObject instance that is affected by the change in focus.
25-
public var relatedObject: InteractiveObject;
25+
private var _relatedObject: InteractiveObject;
2626

2727
// Indicates whether the Shift key modifier is activated, in which case the value is true.
28-
public var shiftKey: Boolean;
28+
private var _shiftKey: Boolean;
2929

3030
// The key code value of the key pressed to trigger a keyFocusChange event.
31-
public var keyCode: uint;
31+
private var _keyCode: uint;
3232

3333
// Specifies direction of focus for a focusIn event.
34-
[API("661")]
35-
public var direction: String;
34+
private var _direction: String;
3635

3736
// If true, the relatedObject property is set to null for reasons related to security sandboxes.
38-
public var isRelatedObjectInaccessible: Boolean;
37+
private var _isRelatedObjectInaccessible: Boolean;
3938

4039
public function FocusEvent(type:String, bubbles:Boolean = true, cancelable:Boolean = false, relatedObject:InteractiveObject = null,
4140
shiftKey:Boolean = false, keyCode:uint = 0, direction:String = "none")
@@ -47,7 +46,45 @@ package flash.events
4746
this.direction = direction;
4847
this.isRelatedObjectInaccessible = false; // Unimplemented
4948
}
50-
49+
50+
public function get relatedObject():InteractiveObject {
51+
return this._relatedObject;
52+
}
53+
public function set relatedObject(value:InteractiveObject):void {
54+
this._relatedObject = value;
55+
}
56+
57+
public function get shiftKey():Boolean {
58+
return this._shiftKey;
59+
}
60+
public function set shiftKey(value:Boolean):void {
61+
this._shiftKey = value;
62+
}
63+
64+
public function get keyCode():uint {
65+
return this._keyCode;
66+
}
67+
public function set keyCode(value:uint):void {
68+
this._keyCode = value;
69+
}
70+
71+
[API("661")]
72+
public function get direction():String {
73+
return this._direction;
74+
}
75+
[API("661")]
76+
public function set direction(value:String):void {
77+
this._direction = value;
78+
}
79+
80+
[API("667")]
81+
public function get isRelatedObjectInaccessible():Boolean {
82+
return this._isRelatedObjectInaccessible;
83+
}
84+
[API("667")]
85+
public function set isRelatedObjectInaccessible(value:Boolean):void {
86+
this._isRelatedObjectInaccessible = value;
87+
}
5188

5289
// Creates a copy of the FocusEvent object and sets the value of each property to match that of the original.
5390
override public function clone():Event

0 commit comments

Comments
 (0)