UIFTETextField“方向”
我使用以下代码创建 UIFTETextField:
var text1_txt:UIFTETextField = new UIFTETextField();
addChild (text1_txt );
这会导致以下错误:
参数方向必须是可接受的值之一。
我完全不知道这是怎么回事,因为我还没有设置任何东西。
我使用的是 Flex 4.1 ACTIONSCRIPT,而不是 MXML。
李
I am using the following code to create a UIFTETextField:
var text1_txt:UIFTETextField = new UIFTETextField();
addChild (text1_txt );
Which results in the following error:
Parameter direction must be one of the accepted values.
I have absolutely no idea what this is about since I have not set anything.
I am using Flex 4.1 ACTIONSCRIPT, not MXML.
lee
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用具有宽度和高度的组件,那么它可以轻松渲染:(
例如
If You Use Component With Width And Height Then It Can Be Rendered Easiely :(
Such As
如果您使用的是 Flash Builder,则可以将断点设置到
mx.core.FTETextField
的public function set Direction(value:String):void
方法,并查看传递的值那里抛出异常。编辑:
另一个想法是你的代码的问题在哪里。如果您的项目不是 Flex 项目而是 ActionScript 项目(从您的问题来看,并不清楚您是在 ActionScript 类还是 ActionScript 项目中使用
UIFTETextField
),我说得对吗?如果是这样,问题就出在样式上。UIFTETextField
依赖 CSS 样式来获取方向和其他一些参数。并且无法直接设置样式(按设计)。有两种可能的解决方案:
mx.core.FTETextField
。这不依赖于风格。UIFTETextField
的组件的样式。就像以下示例中的内容一样。并且不要忘记将direction
样式设置为“rtl”
。If you're using Flash Builder you can set breakpoint to the
public function set direction(value:String):void
method ofmx.core.FTETextField
and see what value passed there to throw exception.EDIT:
Another idea where is the problem of your code. Am I right if your project isn't Flex project but ActionScript project (from your question it is not absolutely clear do you using
UIFTETextField
in ActionScript class or ActionScript project)? If so the problem is in styles.UIFTETextField
relies on CSS styles in getting direction and some other parameters. And there is no way to set styles directly (by design).There can be two possible solutions:
mx.core.FTETextField
. It isn't depend on styles.UIFTETextField
, before instantiation. Something like in the following sample. And do not forget to setdirection
style to"rtl"
.