English 中文(简体)
意想不到的鞭笞, 括号,和松饼?
原标题:ActionScript Unexpected Slashes, Parenthesis, and Squiggly-brackets?
最佳回答

那么,这就是:

    txt = txt.replace("'", "@");
if ((txt.indexOf("[rainbow]") > -1) && (txt.indexOf("[/rainbow]") > -1)) {
    var firstChar = txt.indexOf("[rainbow]") + 9;
    var lastChar = txt.indexOf("[/rainbow]");

    while (lastChar <= txt.lastIndexOf("[/rainbow]")) {
        var RAINBOWTEXT =   ;
        var i = firstChar;
        while (i < lastChar) {
            RAINBOWTEXT += txt.charAt(i);
            i++
        }
        var text = RAINBOWTEXT;
        var texty =   ;

        colors = new Array( ff00ff , ff00cc , ff0099 , ff0066 , ff0033 , ff0000 , ff3300 , ff6600 , ff9900 , ffcc00 , ffff00 , ccff00 , 99ff00 , 66ff00 , 33ff00 , 00ff00 , 00ff33 , 00ff66 , 00ff99 , 00ffcc , 00ffff , 00ccff , 0099ff , 0066ff , 0033ff , 0000ff , 3300ff , 6600ff , 9900ff , cc00ff );

        i = 0;

        while (i <= text.length) {
            var t = text.charAt(i);

            if (t != undefined) {
                texty += "<font color="#" + colors[i % colors.length] + "">" + t + "</font>";
                i++;
            }
        }

        texty = texty.replace("> <", ">&nbsp;<");
        var REPLACEME = "[rainbow]" + RAINBOWTEXT + "[/rainbow]";
        txt = txt.replace(REPLACEME, texty);

        if (lastChar == txt.lastIndexOf("[/rainbow]")) {
            break;
        }
        nextChar = lastChar + 10;
        firstChar = txt.indexOf("[rainbow]", lastChar) + 9;
        lastChar = txt.indexOf("[/rainbow]", lastChar);
    }
}
txt = txt.replace("@", "&apos;");
问题回答

暂无回答




相关问题
Flex: Text Input that accepts number only

Need a code that only accepts numbers. Upon inputting, the code must check if it is number, if not, it must remove the entered key or not enter it at all

How to dynamically generate variables in Action Script 2.0

I have a for loop in action script which I m trying to use to dynamically create variable. Example for( i = 0 ; i &lt 3 ; i++) { var MyVar+i = i; } after this for loop runs, i would like to ...

drag file(s) from destop directly to flash webpage

Could someone please let me know if is possible to drag (multiple) files from desktop directly into a flash webpage. If yes could you please link me to some online resources.

Can XMLSocket send more than once in a frame?

I have a XMLSocket and I call send twice in the same function. The first send works but the second does not? Does XMLSocket have a restriction to only send one message per frame? Do I have to queue ...

How do you stop a setInterval function?

I have a function that I want to run at an interval within a frame. I use the following code to start the function: var intervalID = setInterval(intervalFunction, 3000); Then, in a button s ...

What s a good way of deserializing data into mock objects?

I m writing a mock backend service for my flex application. Because I will likely need to add/edit/modify the mock data over time, I d prefer not to generate the data in code like this: var mockData =...

热门标签