-
Flash Genie
#2007: Parameter child must be non-null.
am getting error, when i click input text field then only it goes to next scene, i want to use it without click input text... and also getting this error?
error i.e.
TypeError: Error #2007: Parameter child must be non-null.
at flash.display:isplayObjectContainer/addChild()
myFormat.font = myFont.fontName;
//myFormat.align = TextFormatAlign.CENTER;
//creating text filed
theTextField= new TextField();
//theTextField.text= "";
theTextField.defaultTextFormat = myFormat;
theTextField.type = TextFieldType.INPUT;
theTextField.border = true;
theTextField.width = 270;
theTextField.height = 80;
theTextField.x = 620;
theTextField.y = 310;
theTextField.multiline = true;
//theTextField.wordWrap = true;
theTextField.background = true;
addChild(theTextField);
theTextField.addEventListener(TextEvent.TEXT_INPUT , inputEventCapture);
public function createOutputBox(str:String):void {
var myFont = new cfont();
var myFormat2:TextFormat = new TextFormat();
}
Charag - 3D, Flash Games, Animations,
Website Development & More...
-
Did you declare what theTextField is?
PHP Code:
var theTextField:TextField = new TextField ();
If you want every keystroke to be captured by the TextField you can do
PHP Code:
stage.addEventListener (KeyboardEvent.KEY_DOWN, onStageKeyDown); function onStageKeyDown (e:KeyboardEvent) { stage.focus = theTextField; }
Every button you press on your keyboard will be captured by the TextField regardless of what you click on the stage because the focus will be on the TextField every time you press a key.
-
Flash/Flex Developer
Move your addEventListener prior to the addChild command.
Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.
-
Flash Genie
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|