{"id":296,"date":"2010-04-21T15:57:54","date_gmt":"2010-04-21T07:57:54","guid":{"rendered":"http:\/\/www.wlash.com\/blog\/?p=296"},"modified":"2010-04-21T15:57:54","modified_gmt":"2010-04-21T07:57:54","slug":"textfield-appendtextnewtextstring-in-flash-as3","status":"publish","type":"post","link":"https:\/\/blog2.wwhhoo.com\/?p=296","title":{"rendered":"TextField.appendText(newText:String) in flash AS3"},"content":{"rendered":"<div class=\"summarySignature\"><a href=\"http:\/\/livedocs.adobe.com\/flash\/9.0\/ActionScriptLangRefV3\/flash\/text\/TextField.html#appendText%28%29\" target=\"_blank\" rel=\"noopener\"><span class=\"signatureLink\">appendText<\/span>(newText:String):void<\/a><\/div>\n<div class=\"summaryTableDescription\">\u5c06 newText \u53c2\u6570\u6307\u5b9a\u7684\u5b57\u7b26\u4e32\u8ffd\u52a0\u5230\u6587\u672c\u5b57\u6bb5\u7684\u6587\u672c\u7684\u672b\u5c3e\u3002<!--more--><\/div>\n<div class=\"summaryTableDescription\">\u5728AS3\u4e2d\uff0c\u5982\u679c\u4ee3\u7801\u5199\u6210<span style=\"background-color: rgb(211, 211, 211);\">text_txt.text += &quot;add new content&quot;<\/span> \u6216<span style=\"background-color: rgb(211, 211, 211);\"> text_txt.text = text_txt.text + &quot;add new content<\/span>&quot;\u65f6\uff0c\u5728\u53d1\u5e03SWF\u7684\u65f6\u5019\uff0c\u5c31\u4f1a\u5f39\u51fa\u8b66\u544a\u4fe1\u606f\uff0c\u5efa\u8bae\u4f7f\u7528<span style=\"background-color: rgb(211, 211, 211);\">appendText(newText:String)<\/span>\u7684\u65b9\u6cd5\u3002<\/div>\n<div class=\"summaryTableDescription\">\u5f53\u7528appendText(newText:String)\u65b9\u6cd5\u65f6\uff0cnewText\u5b57\u4e32\u4e0d\u8981\u4f7f\u7528&quot;r&quot;\u6765\u6362\u884c\uff0c\u800c\u5e94\u4f7f\u7528&quot;n&quot;\uff0c\u5982\u679c\u662f\u4f7f\u7528&quot;r&quot;\uff0c\u5219\u4f1a\u5728\u5012\u6570\u7684\u7b2c\u4e8c\u4e2a\u5b57\u7b26\u5f00\u59cb\u63d2\u5165&quot;r&quot;\uff0c\u800c\u4e0d\u662f\u672b\u5c3e\u3002\u800c\u7528&quot;n&quot;\u5c31\u4e0d\u4f1a\u5b58\u5728\u8fd9\u4e2a\u95ee\u9898\uff0c\u5982\u679c\u662f\u5ffd\u7565appednText\u7684\u8b66\u544a\u800c\u7ee7\u7eed\u4f7f\u7528text_txt.text += &ldquo;add new contentr&rdquo;\u5c31\u4f1a\u5b58\u5728\u4e4b\u524d\u8bf4\u7684\u95ee\u9898\uff0c<\/div>\n<div class=\"summaryTableDescription\">appendText\u65b9\u6cd5\u8fd8\u4f1a\u5b58\u5728\u53e6\u4e00\u4e2a\u95ee\u9898\uff0c\u5f53\u6211\u5bf9\u4e00\u4e2a\u6587\u672c\u6846\u4f7f\u7528\u6dfb\u52a0\u6587\u5b57\u540e\uff0c\u5219TextField.<span class=\"signatureLink\">scrollV\u4f1a\u88ab\u521d\u59cb\u4e3a1\uff0c\u4e0d\u7ba1\u5f53\u524d\u503c\u4e3a\u4f55\u503c\u3002\u6211\u4e0d\u6e05\u695a\u8fd9\u662fbugs\u8fd8\u662f\u672c\u610f\u5c31\u662f\u8981\u8fd9\u6837\u7684\u3002<br \/>\n\t<\/span><\/div>\n<div class=\"summaryTableDescription\">\u8981\u89e3\u51b3\u8fd9\u6837\u7684\u95ee\u9898\uff0c\u53ea\u6709:<\/div>\n<div class=\"summaryTableDescription\"><span style=\"background-color: rgb(211, 211, 211);\">var str:String = text_txt.text;<br \/>\n\t<\/span><\/div>\n<div class=\"summaryTableDescription\"><span style=\"background-color: rgb(211, 211, 211);\">str += &quot;add new contentr&quot;;<br \/>\n\t<\/span><\/div>\n<div class=\"summaryTableDescription\"><span style=\"background-color: rgb(211, 211, 211);\">text_txt.text = str;<br \/>\n\t<\/span><\/div>\n<div class=\"summaryTableDescription\">\u867d\u7136\u8fd9\u6837\u6267\u884c\u6548\u7387\u6ca1appendText\u9ad8\uff0c\u4f46\u80fd\u89e3\u51b3scrollV\u7684\u95ee\u9898\u3002<\/div>\n<div class=\"summaryTableDescription\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/div>\n<div class=\"summaryTableDescription\">\u6700\u540e\u6211\u4e0a\u7f51\u627e\u4e86\u4e00\u4e0b\u5173\u4e8e&quot;r&quot;\u4e0e&quot;n&quot;\u7684\u533a\u522b\uff0c<\/div>\n<div class=\"summaryTableDescription\">Windows \u91c7\u7528 rn \u662f\u6709\u539f\u56e0\u7684\uff0cWindows \u91c7\u7528\u4e86\u4f20\u7edf\u7684\u82f1\u6587\u6253\u5b57\u673a\u7684\u6a21\u5f0f\u3002<\/p>\n<p>\t\u60f3\u60f3\u770b\u82f1\u6587\u6253\u5b57\u673a\u662f\u5982\u4f55\u6362\u884c\u7684\u5462\uff1f\u82f1\u6587\u6253 \u5b57\u673a\u662f\u9009\u62e9\u5c06\u5c0f\u8f66\u9000\u56de\u81f3\u8d77\u70b9\uff0c<br \/>\n\t\u8fd9\u4e2a\u8fc7\u7a0b\u79f0\u4e3a\u56de\u8f66\uff08carriage return, CR\uff09\uff0c\u968f\u540e\u628a\u5c0f\u8f66\u8c03\u81f3\u4e0b\u4e00\u884c\u7684\u4f4d<br \/>\n\t\u7f6e\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u79f0\u4e3a \u6362\u884c\uff08line feed, LF\uff09\uff0c\u8fd9\u6837\u5c31\u5b8c\u6210\u4e86\u82f1\u6587\u6253\u5b57\u673a\u4e2d\u6362<br \/>\n\t\u884c\u8fc7\u7a0b\u3002<\/p>\n<p>\t\u56de\u8f66\uff08CR\uff09\u5728\u8ba1\u7b97\u673a\u4e2d\u4f7f\u7528 ASCII \u4e3a 13\uff080x0D\uff09 \u7684\u5b57\u7b26\u6765\u8868\u793a\uff0c\u6362\u884c\uff08LF\uff09\u4f7f\u7528<br \/>\n\tASCII \u4e3a 10\uff080x0A\uff09 \u7684\u5b57\u7b26\u6765\u8868\u793a\u3002\u8fd9\u4e5f\u5c31\u662f Windows \u7684\u6362\u884c\u91c7\u7528 rn \u6765\u8868\u793a<br \/>\n\t\u7684\u539f\u56e0\u3002<\/div>\n<div class=\"summaryTableDescription\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/div>\n<div class=\"summaryTableDescription\">\u5728windows\u64cd\u4f5c\u7cfb\u7edf\u4e0b\uff0c\u6309\u56de\u8f66\u6362\u884c\u5c31\u4f1a\u751f\u6210\u4e24\u4e2a\u5b57\u7b26\uff0c\u800c\u5728\u5176\u5b83\u7cfb\u7edf\u53ea\u6709\u4e00\u4e2a\u5b57\u7b26&quot;n&quot;<\/div>\n<div class=\"summaryTableDescription\">\u6240\u4ee5\uff0c\u5728windows\u4e0b\u5199\u7684xml\u6587\u4ef6\uff0c\u5982\u679c\u5728&lt;![CDATA[ &#8230; ]]&gt;\u4e2d\u5b9a\u4e49\u7684\u6362\u884c\u7684\u5b57\u7b26\uff0c\u5219\u8981\u628a<\/div>\n<div class=\"summaryTableDescription\">&#39;rn&#39;\u8f6c\u4e3a&#39;n&#39;\uff0c\u5426\u5219\u5728flash\u52a8\u6001\u6587\u672c\u6846 \u4e2d\u5c31\u4f1a\u663e\u793a\u4e3a\u4e24\u4e2a\u6362\u884c\u3002<span style=\"background-color: rgb(211, 211, 211);\">str.split(&quot;rn&quot;).join(&quot;n&quot;);<\/span><\/div>\n","protected":false},"excerpt":{"rendered":"<p>appendText(newText:String):void \u5c06 newText \u53c2\u6570\u6307\u5b9a\u7684\u5b57\u7b26\u4e32\u8ffd\u52a0\u5230\u6587\u672c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[9],"class_list":["post-296","post","type-post","status-publish","format-standard","hentry","category-3","tag-as3"],"_links":{"self":[{"href":"https:\/\/blog2.wwhhoo.com\/index.php?rest_route=\/wp\/v2\/posts\/296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog2.wwhhoo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog2.wwhhoo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog2.wwhhoo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog2.wwhhoo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=296"}],"version-history":[{"count":0,"href":"https:\/\/blog2.wwhhoo.com\/index.php?rest_route=\/wp\/v2\/posts\/296\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog2.wwhhoo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog2.wwhhoo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog2.wwhhoo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}