-
-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This test verifies the behavior of Selection.getFocus() when the focus is removed.
- Loading branch information
1 parent
b551d14
commit b3091ec
Showing
4 changed files
with
73 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,24 @@ | ||
===== clip | ||
Object: _level0.clip | ||
Focus changed | ||
old: null | ||
new: _level0.clip | ||
Focus: _level0.clip | ||
Focus: null | ||
Focus: null | ||
===== text | ||
Object: _level0.clip.text | ||
Focus changed | ||
old: null | ||
new: _level0.clip.text | ||
Focus: _level0.clip.text | ||
Focus: null | ||
Focus: null | ||
===== button | ||
Object: _level0.clip.button | ||
Focus changed | ||
old: null | ||
new: _level0.clip.button | ||
Focus: _level0.clip.button | ||
Focus: null | ||
Focus: null |
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,48 @@ | ||
var listener = new Object(); | ||
listener.onSetFocus = function(oldFocus, newFocus) { | ||
if (newFocus) { | ||
trace("Focus changed"); | ||
trace(" old: " + oldFocus); | ||
trace(" new: " + newFocus); | ||
} | ||
}; | ||
Selection.addListener(listener); | ||
|
||
function testObject(create, remove) { | ||
var obj = create(); | ||
trace("Object: " + obj); | ||
obj.focusEnabled = true; | ||
Selection.setFocus(obj); | ||
trace("Focus: " + Selection.getFocus()); | ||
remove(); | ||
trace("Focus: " + Selection.getFocus()); | ||
|
||
create(); | ||
trace("Focus: " + Selection.getFocus()); | ||
remove(); | ||
} | ||
|
||
trace("===== clip"); | ||
testObject(function() { | ||
return _root.createEmptyMovieClip("clip", 2); | ||
}, function() { | ||
_root.clip.removeMovieClip(); | ||
}); | ||
|
||
trace("===== text"); | ||
testObject(function() { | ||
var mc = _root.createEmptyMovieClip("clip", 3); | ||
var tf = mc.createTextField("text", 1, 0, 0, 150, 20); | ||
tf.type = "input"; | ||
return tf; | ||
}, function() { | ||
_root.clip.removeMovieClip(); | ||
}); | ||
|
||
trace("===== button"); | ||
testObject(function() { | ||
var mc = _root.attachMovie("CustomButton", "clip", 3); | ||
return mc.button; | ||
}, function() { | ||
_root.clip.removeMovieClip(); | ||
}); |
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 |