Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 as3 textfield wordwrap true导致textwidth异常_Actionscript 3 - Fatal编程技术网

Actionscript 3 as3 textfield wordwrap true导致textwidth异常

Actionscript 3 as3 textfield wordwrap true导致textwidth异常,actionscript-3,Actionscript 3,我试图在按钮中对文本字段进行文字包装,但是在我将文字包装设置为true之后,发生了一些意外行为 Button.width = 390; Button.textField.autoSize = TextFieldAutoSize.LEFT; Button.textField.border = true; Button.textField.wordwrap = true; Button.textField.multiline = true; Button.textField.width = text

我试图在按钮中对文本字段进行文字包装,但是在我将文字包装设置为true之后,发生了一些意外行为

Button.width = 390;
Button.textField.autoSize = TextFieldAutoSize.LEFT;
Button.textField.border = true;
Button.textField.wordwrap = true;
Button.textField.multiline = true;
Button.textField.width = textButton.width - 10;
Button.textField.x = 5;
Button.height = 60;
情况就是这样:


当我输出Button.textField.textWidth时,它显示的值似乎比Button或Button.textField.width小很多。我只想在textwidth满足textField.width最大值后使单词中断。我能做些什么来改变这种行为吗…因为我无法更改Button.textField.textWidth的只读值。

注释掉Button.textField.autoSize设置。这可能就是把一切都扔掉的原因


当您设置width=textButton.width-10时,您将文本字段的宽度设置为与按钮的大小相匹配,但在设置autoSize设置时,您也会告诉它自动调整文本字段的大小以与实际文本的大小相匹配。因此,它无法按您希望的方式安装按钮。

尝试注释button.textField.autoSize后,它变得更加怪异XD,单词的第二行变得不可见,只有当im滚动按钮时才能看到。Button.textField.textWidth也没有更改。我有预感这种行为是因为我使用的是fl.controls.button组件。但是我看不出有什么问题。试着设置宽度和高度以匹配按钮的宽度和高度。你有发生什么事的截图吗?上面的imgur链接就是截图。textfield组件的宽度与按钮的宽度相同,但不知何故,文本无法识别该宽度,因此变得更小。