Try... this?
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@232 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -44,13 +44,16 @@ import com.threerings.flash.MediaContainer;
|
|||||||
//
|
//
|
||||||
public class GameContainer extends VBox
|
public class GameContainer extends VBox
|
||||||
{
|
{
|
||||||
|
public var keyGrabber :TextField = new TextField();
|
||||||
|
|
||||||
public function GameContainer (url :String)
|
public function GameContainer (url :String)
|
||||||
{
|
{
|
||||||
rawChildren.addChild(_keyGrabber = new TextField());
|
keyGrabber.selectable = false;
|
||||||
_keyGrabber.selectable = false;
|
rawChildren.addChild(keyGrabber);
|
||||||
|
|
||||||
rawChildren.addChild(_game = new MediaContainer(url));
|
rawChildren.addChild(_game = new MediaContainer(url));
|
||||||
|
|
||||||
tabEnabled = true; // turned off by Container
|
// tabEnabled = true; // turned off by Container
|
||||||
// focusRect = true; // we need the focus rect
|
// focusRect = true; // we need the focus rect
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,8 +65,8 @@ public class GameContainer extends VBox
|
|||||||
override public function setActualSize (w :Number, h :Number) :void
|
override public function setActualSize (w :Number, h :Number) :void
|
||||||
{
|
{
|
||||||
super.setActualSize(w, h);
|
super.setActualSize(w, h);
|
||||||
_keyGrabber.width = w;
|
keyGrabber.width = w;
|
||||||
_keyGrabber.height = h;
|
keyGrabber.height = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
// override public function setFocus () :void
|
// override public function setFocus () :void
|
||||||
|
|||||||
@@ -521,9 +521,9 @@ public class GameControlBackend
|
|||||||
keyEventType :String, add :Boolean) :void
|
keyEventType :String, add :Boolean) :void
|
||||||
{
|
{
|
||||||
if (add) {
|
if (add) {
|
||||||
_container.addEventListener(keyEventType, handleKeyEvent);
|
_container.keyGrabber.addEventListener(keyEventType, handleKeyEvent);
|
||||||
} else {
|
} else {
|
||||||
_container.removeEventListener(keyEventType, handleKeyEvent);
|
_container.keyGrabber.removeEventListener(keyEventType, handleKeyEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user