Actionscript 3 Flash文本区域控制中的Bug txtAddress.text=“aaaaaaaaaaaaaaaacccccccc P oabcdefghijklmnopqrstuvxyzwsder-682021”;
此actionscript代码使flash插件崩溃。有时它不会崩溃,但文本区域内的文本将被覆盖两次。我测试过的每个浏览器都是如此。我想这是flash的错误。 (请注意,如果文本区域的宽度或值发生变化,它将正常工作) 有人能对此发表评论吗 下面是标记代码:Actionscript 3 Flash文本区域控制中的Bug txtAddress.text=“aaaaaaaaaaaaaaaacccccccc P oabcdefghijklmnopqrstuvxyzwsder-682021”;,actionscript-3,flash,apache-flex,Actionscript 3,Flash,Apache Flex,此actionscript代码使flash插件崩溃。有时它不会崩溃,但文本区域内的文本将被覆盖两次。我测试过的每个浏览器都是如此。我想这是flash的错误。 (请注意,如果文本区域的宽度或值发生变化,它将正常工作) 有人能对此发表评论吗 下面是标记代码: <s:TextArea id="txtAddress" x="118" y="31" width="150" height="88" maxChars="100" tabIn
<s:TextArea id="txtAddress" x="118" y="31" width="150" height="88" maxChars="100"
tabIndex="2"/>
txtAddress.text="AAAAAAAAAAAA CCCCCCCCCCCCCCCCCCCCCC P OABCDEFGHIJKLMNOPQRSTUVWXYZWSDER-682021";
这与您的系统或实现是隔离的 您提供的是功能性的:
<s:BorderContainer x="2" y="32" height="125" width="565" borderColor="#488AC7"
backgroundColor="#EEF0EE" cornerRadius="2">
<s:TextInput id="txtPhoneNo" x="407" y="3" width="150" maxChars="15" tabIndex="3"/>
<s:Label x="12" y="13" text="Name" fontWeight="normal" />
<s:TextInput x="118" y="3" width="150" id="txtName" maxChars="100" tabIndex="1" />
<s:Label x="12" y="40" text="Address" fontWeight="normal"/>
<s:TextArea id="txtAddress" x="118" y="31" width="150" height="88" maxChars="100"
tabIndex="2"/>
<s:Label x="302" y="13" text="Phone No." fontWeight="normal"/>
<s:Label x="302" y="40" text="Mobile" fontWeight="normal" />
<s:TextInput id="txtMobile" x="407" y="31" width="150" maxChars="15" tabIndex="4"/>
<s:Label x="302" y="70" text="Email" fontWeight="normal" />
<s:TextInput id="txtEmail" x="407" y="60" width="150" maxChars="100" tabIndex="5"/>
<s:Label x="302" y="101" text="ECS Account NO"/>
<s:TextInput id="txtECSAcNo" x="407" y="91" width="150" tabIndex="6"/>
</s:BorderContainer>
似乎在其他地方,您将textarea的fontsize设置为无效值。我以前也遇到过同样的问题,也许在某个地方你只是将它设置为“10px”之类的值。谢谢你的评论。。我正在更新按钮点击处理程序中的textatrea。请清除插件缓存并更新按钮点击处理程序中的文本。没有区别-非常好。同样,这可能是在实现的其他地方造成的。可能是项目渲染器或父组件导致了这种情况。安装Flash调试播放器并提供崩溃的详细信息。字体显示为“加倍”通常是每个Flex实现的生命周期问题。
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="creationCompleteHandler(event)">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
protected function creationCompleteHandler(event:FlexEvent):void
{
txtAddress.text = "AAAAAAAAAAAA CCCCCCCCCCCCCCCCCCCCCC P OABCDEFGHIJKLMNOPQRSTUVWXYZWSDER-682021";
}
]]>
</fx:Script>
<s:TextArea id="txtAddress"
x="118"
y="31"
width="150"
height="88"
maxChars="100"
tabIndex="2" />
</s:Application>