-
-
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.
This test verifies the behavior of stage.focus when the focus is removed from the stage.
- Loading branch information
1 parent
b3091ec
commit 45dca76
Showing
4 changed files
with
65 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,44 @@ | ||
package { | ||
|
||
import flash.display.DisplayObject; | ||
import flash.display.InteractiveObject; | ||
import flash.display.InteractiveObject; | ||
import flash.display.InteractiveObject; | ||
import flash.display.SimpleButton; | ||
import flash.display.Sprite; | ||
import flash.events.KeyboardEvent; | ||
import flash.text.TextField; | ||
import flash.text.TextField; | ||
import flash.display.Sprite; | ||
import flash.display.SimpleButton; | ||
import flash.display.MovieClip; | ||
import flash.events.Event; | ||
import flash.events.FocusEvent; | ||
|
||
[SWF(width="50", height="50", backgroundColor="#000000")] | ||
public class Test extends MovieClip { | ||
public function Test() { | ||
super(); | ||
|
||
trace("===== sprite"); | ||
testObject(new Sprite()); | ||
trace("===== clip"); | ||
testObject(new MovieClip()); | ||
trace("===== text"); | ||
testObject(new TextField()); | ||
trace("===== button"); | ||
testObject(new SimpleButton()); | ||
} | ||
|
||
function testObject(obj:InteractiveObject) { | ||
stage.focus = obj; | ||
trace("Focus: " + stage.focus); | ||
stage.addChild(obj); | ||
trace("Focus: " + stage.focus); | ||
stage.removeChild(obj); | ||
trace("Focus: " + stage.focus); | ||
stage.focus = obj; | ||
trace("Focus: " + stage.focus); | ||
} | ||
} | ||
} |
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,20 @@ | ||
===== sprite | ||
Focus: [object Sprite] | ||
Focus: [object Sprite] | ||
Focus: null | ||
Focus: [object Sprite] | ||
===== clip | ||
Focus: [object MovieClip] | ||
Focus: [object MovieClip] | ||
Focus: null | ||
Focus: [object MovieClip] | ||
===== text | ||
Focus: [object TextField] | ||
Focus: [object TextField] | ||
Focus: null | ||
Focus: [object TextField] | ||
===== button | ||
Focus: [object SimpleButton] | ||
Focus: [object SimpleButton] | ||
Focus: null | ||
Focus: [object SimpleButton] |
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 |