解决方法对于文本字段10.3.183.7错误的FP 10.3.183.5和字段、解决方法、文本、错误

2023-09-08 11:55:30 作者:喧嚣的世间

我是谁与AS2应用程序有一个大问题,一个客户端,我们开发了一个几年前。

I have a client who is having a big problem with an AS2 application we developed a few years ago.

据我所知,这是在最近的Flash播放器版本,不会引起一个公认的bug(见的 http://forums.adobe.com/message/3859034 和的 https://bugbase.adobe.com/index.cfm?event=bug&id=2941694 )。

As far as I can tell, it is being caused by an acknowledged bug in recent versions of Flash Player (see http://forums.adobe.com/message/3859034 and https://bugbase.adobe.com/index.cfm?event=bug&id=2941694).

两个版本FP受到影响(10.3.183.5和10.3.183.7),并修正了10.3.183.10。

Two versions of FP are affected (10.3.183.5 and 10.3.183.7), and the bug was fixed in 10.3.183.10.

显然,升级Flash Player将解决这个问题,但我们都知道用户不总是这样做,她已经越来越电子邮件有关的问题。

Obviously, upgrading Flash Player will fix the problem, but we all know users don't always do this and she has been getting emails about the problem.

我考虑有她更新的SWFObject的code明确地检测为10.3.183.10,并有防爆pressInstall鼓励用户进行升级,但我不知道这是否会飞翔。

I am contemplating having her update the SWFObject code to explicitly detect for 10.3.183.10 and have ExpressInstall "encourage" users to upgrade, but I don't know if this will fly.

我尝试了好几种,搜索人员发现了解决方法,但没有工作在我的情况。

I have tried several of the workaround that searches have uncovered, but none are working in my case.

我想知道是否有人已经找到了解决这一问题的可靠途径?

I was wondering if anyone has found a reliable way to fix this?

推荐答案

首先我会尝试将使用textField.htmlText代替的TextField.text,看看如果不解决这个问题(虽然我会感到很惊讶如果它这样做)。

First thing I would try would be to use the textField.htmlText instead of textField.text and see if that doesn't solve it (although I would be surprised if it did).

我可以看到解决这个(这是真的不pretty的)第二个潜在的方法就是手动换行。以下是AS3,因为这是我使用。我会离开它你将其转换为AS2但我认为这应该是可能的AS2为好。

Second potential way I can see fixing this (and this is really not pretty) is to manually wordwrap. The following is in AS3 because that's what I use. I'll leave it to you to convert it to AS2 but I assume this should be possible in AS2 as well.

var text : String = "some text here";
var textField : TextField = new TextField();
textField.wordwrap  = false;
textField.multiline = false;
textField.autosize  = false;
textField.width     = MAX_TEXT_WIDTH;
//other formatting stuff

var words : Array  = text.split(" ");
var line  : String = words[0];
textField.text     = words[0];

var lines : Array = new Array();//will contain all lines
for(var i : int = 1; i < words.length; ++i)//start at second word
{
    textField.text += " " + words[i];//try adding another word to the line
    if(textField.textWidth > MAX_TEXT_WIDTH)//overflowed line
    {
        lines.push(line);
        line = words[i];
        textField.text = line;
    }
    else//doesn't overflow, line is still valid
    {
        lines += textField.text;
    }
}
lines.push(line);

var text : String = lines[0];
for(i = 1; i < lines.length; ++i)
{
    text += "\n" + lines[i];
}

textField.multiline = true;
textField.height = lines.length * HEIGHT_PER_LINE;//HEIGHT_PER_LINE can be found using getLineMetrics and 
                                                  //adding gutter pixels to the height - might have to 
                                                  //play a little with this
textField.text = text;

不知道这个编译(这是probly不是AS2反正兼容),但是这应该给的总体思路。不要将自动换行自己,看看是否可行。另外,还要确保该格式是适用于文本,而你正在检查输出textWidth。我认为你需要调用setTextFormat(myTextFormat)每次你改变的TextField.text值。

Not sure this compiles (it's probly not AS2 compatible anyways) but this should give the general idea. Do the wordwrapping yourself and see if that works. Also make sure that the formatting is applying to the text while you are checking for textWidth. I think you need to call setTextFormat(myTextFormat) everytime you change the textField.text value.

我也看到了,显然多行可能无法在该版本的工作。如果是这样的话,你可能要做出一个新的TextField对象的每一行,并弥补其y值,使它看起来就像是相同的文本字段(希望您不使用边框或背景上的文本框,如果是这样的话)

I also saw that apparently multiline might not work in that version. If that is the case, you might have to make a new TextField object for each line and offset their y values to make it look like it's the same TextField (hopefully you aren't using borders or backgrounds on your textFields if this is the case)