Flash textarea对齐和符号 [英] Flash textarea alignment and symbols

查看:74
本文介绍了Flash textarea对齐和符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个动态文本框,显示连接到mysql表的php网页的数据。现在我面临的问题如下:

1 - 我无法显示像& %''等闪存只是忽略这些符号后面的数据,例如data = H& M flash显示= H.


我知道为什么它会出现& 但我需要解决问题


2 - flash显示多个换行符例如


案例1:

数据=我的名字是sumaiya


案例2:

数据=我的名字

是sumaiya


在case1中闪存很好但是在case2中它显示了换行没有< br> ++。我想解决这个问题.....请帮助!!

i have a dynamic textbox displaying data from a php webpage which is connected to a mysql table. Now the problem i am facing is as follows:

1 - I cannot display symbols like & % '' etc flash just ignores the data after these symbols eg data=H & M flash displays = H.

I know why it exepts & but i need to get around the problem

2 - flash is displaying multiple line breaks Eg

Case 1:
Data = my name is sumaiya

Case 2:
data = my name
is sumaiya

In case1 flash is fine but in case2 it displays a line break whn there is no <br>++. I neeeed to get around this problem..... Please Help!!

推荐答案

sumaya。

我建议你使用PHP使用DB结果输出XML,因为Flash XML停顿功能非常棒。所以你用PHP来读取XML(php)文件。

无论如何,你仍然会遇到同样的问题,那就是特殊字符的问题。假设你有一个XML标签< data>它将包含从DB加载的一些文本数据,首先需要在CDATA块之间放入数据中的任何内容,CDATA块是这样写的,开始标记是<![CDATA [和结束标记] ]>,所以它将如下所示:


< data><![CDATA [此处从数据库加载的内容]]>< / data>

CDATA(字符数据)块允许在标签内写入特殊字符。


现在你需要php将任何特殊字符转换为HTML特殊字符表单,你可以通过传递从CB返回的内容通过htmlspecialchars方法或htmlentities方法,最后一个更严格,因为它将几乎任何非utf-8字符转换为html特殊字符表示法(如& amp;写的& amp;)。

无论如何,Flash的HTML处理能力非常差。并且可能不会读取任何特殊字符,原因是因为它会再次转换它,转换这个& amp;对此:& amp& amp;让它完全不可读。有一个解决方案,就是过滤那些特殊的字符并在ActionScript中重新构建它们,事情是,我今天不在家,我将在周末休息。但是只要我回到家,我就会发送给你的功能,无论如何它真的很简单。但是我花了很长时间才意识到出了什么问题并想出了这个功能。


祝你好运,

The_Nephilim

Hi, sumaya.
I reccomend you to use PHP to output an XML with the DB results, as Flash XML halding capabilities are awesome. So the you use PHP to read the XML (php) file.
Anyway, you''ll still have the same problem, and that is, problems with special characters. Let''s say you have an XML tag <data> that will contain some text data loaded from the DB, first you need to put any content in the data between a CDATA block, a CDATA block is written like this, the opening tag is <![CDATA[ and the closing tag is ]]>, so it will read as follows:

<data><![CDATA[The content loaded from the db here]]></data>
The CDATA (character data) blocks allows special characters to be written inside the tag.

Now you need php to conver any special chars to the HTML special chars form, you can do it by passing the content returned from the CB through htmlspecialchars method or the htmlentities method, being the last one more strict, as it will conver almost any non utf-8 character to html special character notation (like an & is written &amp;).
Anyway, Flash''s html handling capability is outstandingly poor. And will probably not read any special char, and the reason is because it will transform it again, converting this &amp; to this: &amp&amp; making it totally unreadable. There''s a solution, and that is to filter those special chars and re-construct them in ActionScript, the thing is, I''m not at home today and I''ll be off for the weekend. But as soon as I get home I''ll send you the function to do that, its really simple anyway. but it took me sooo long to realize what went wrong and coming up with this function.

Best regards,
The_Nephilim


i有一个动态文本框,显示连接到mysql表的php网页的数据。现在我面临的问题如下:

1 - 我无法显示像& %''等闪存只是忽略这些符号后面的数据,例如data = H& M flash显示= H.


我知道为什么它会出现& 但我需要解决问题


2 - flash显示多个换行符例如


案例1:

数据=我的名字是sumaiya


案例2:

数据=我的名字

是sumaiya


在case1中闪存很好但是在case2中它显示了换行没有< br> ++。我需要解决这个问题.....请帮助!!
i have a dynamic textbox displaying data from a php webpage which is connected to a mysql table. Now the problem i am facing is as follows:

1 - I cannot display symbols like & % '' etc flash just ignores the data after these symbols eg data=H & M flash displays = H.

I know why it exepts & but i need to get around the problem

2 - flash is displaying multiple line breaks Eg

Case 1:
Data = my name is sumaiya

Case 2:
data = my name
is sumaiya

In case1 flash is fine but in case2 it displays a line break whn there is no <br>++. I neeeed to get around this problem..... Please Help!!


感谢您的回答我将继续努力。


但是,请您解释一下示例,cuz我知道我的PHP / mysql但是xml actionscript在我的脑海里模糊不清。
Thanks for the answer I will work on that.

But can you please explain with examples, cuz i know my PHP/mysql but xml actionscript are a lil blurred in my head.


是的,我回家后会给你写一个完整的例子和一个演示应用程序所以你可以探索它。特别注意XML和ActionScript。


好​​吧,得走了。

见。


祝你好运,

The_Nephilim

Yes, as soon as I get home I''ll write you a full example, and a demo application so you can explore it. Putting special attention to XML and ActionScript.

Well, gotta go.
See you.

Best regards,
The_Nephilim


感谢您的回答我将继续努力。


但是你可以用例子来解释,因为我知道我的PHP / mysql但是xml actionscript在我脑海里模糊不清。
Thanks for the answer I will work on that.

But can you please explain with examples, cuz i know my PHP/mysql but xml actionscript are a lil blurred in my head.


这篇关于Flash textarea对齐和符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆