-
-
Notifications
You must be signed in to change notification settings - Fork 838
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add focus_visibility_change test
This test verifies the behavior of focus when its visibility is changed.
- Loading branch information
Showing
4 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
===== clip | ||
Object: _level0.clip | ||
Made visible | ||
Focus changed | ||
old: null | ||
new: _level0.clip | ||
Focus: _level0.clip | ||
Focus changed | ||
old: _level0.clip | ||
new: null | ||
Made invisible | ||
Focus: null | ||
Made visible | ||
Focus: null | ||
Made invisible | ||
===== text | ||
Object: _level0.text | ||
Made visible | ||
Focus changed | ||
old: null | ||
new: _level0.text | ||
Focus: _level0.text | ||
Focus changed | ||
old: _level0.text | ||
new: null | ||
Made invisible | ||
Focus: null | ||
Made visible | ||
Focus: null | ||
Made invisible | ||
===== button | ||
Object: _level0.button | ||
Made visible | ||
Focus changed | ||
old: null | ||
new: _level0.button | ||
Focus: _level0.button | ||
Focus changed | ||
old: _level0.button | ||
new: null | ||
Made invisible | ||
Focus: null | ||
Made visible | ||
Focus: null | ||
Made invisible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
var listener = new Object(); | ||
listener.onSetFocus = function(oldFocus, newFocus) { | ||
trace("Focus changed"); | ||
trace(" old: " + oldFocus); | ||
trace(" new: " + newFocus); | ||
}; | ||
Selection.addListener(listener); | ||
|
||
function testObject(obj) { | ||
trace("Object: " + obj); | ||
obj._visible = true; | ||
trace("Made visible"); | ||
obj.focusEnabled = true; | ||
Selection.setFocus(obj); | ||
trace("Focus: " + Selection.getFocus()); | ||
obj._visible = false; | ||
trace("Made invisible"); | ||
trace("Focus: " + Selection.getFocus()); | ||
|
||
obj._visible = true; | ||
trace("Made visible"); | ||
trace("Focus: " + Selection.getFocus()); | ||
obj._visible = false; | ||
trace("Made invisible"); | ||
} | ||
|
||
var clip = _root.createEmptyMovieClip("clip", 10); | ||
var text = _root.createTextField("text", 11, 0, 0, 150, 20); | ||
text.type = "input"; | ||
var button = _root.attachMovie("CustomButton", "button", 12); | ||
|
||
trace("===== clip"); | ||
testObject(clip); | ||
|
||
trace("===== text"); | ||
testObject(text); | ||
|
||
trace("===== button"); | ||
testObject(button); |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
num_ticks = 1 |