Hello List,

I'm working with some AS2 code that creates a textfield which has
selectable=false and autoSize=true, and uses asfunction to change its own
contents.

I recently noticed that, while it works successfully on Windows XP and on a
Mac (unsure of version), it does not seem to work on Vista. I should
clarify, it does not seem to work on Vista in a browser (works fine when you
control+enter).

After a fair amount of un/commenting, it seems like the problem is that, on
Vista, you can't have selectable=false AND autoSize=true and expect
asfunction to work. It works fine if you comment out either of those lines.

If anyone has Vista, I would sincerely appreciate it if you could give it a
burl in a browser, sample code below, just copy and paste. I only have
access to one Vista machine, so it would be great to get some confirmation.

And if anyone could shed some light on why this is happening at all, 'twould
be 'twerrific!

(I understand that "Use AS3" is the answer to many problems, but
unfortunately I'm not in the position to do that right now).

Thanks very much!


// --- Click on a word to embolden it.
// --- Code begins.

var str:String = "The quick brown fox jumps over the lazy dog.";
var str_array:Array = str.split(" ");
var newStr:String = "";
var clicked_array:Array = [];

this.createTextField("content_txt",this.getNextHighestDepth(),10,10,300,50);
with (content_txt) {
    autoSize = true;
    selectable = false;
    border = true;
    html = true;
    wordWrap = true;
}

function render() {
    newStr = "";
    for (var i = 0; i<str_array.length; i++) {
        if (clicked_array[i] == 1) {
            newStr += "<b>";
        }
        newStr += "<a href='asfunction:clickedOn,"+i+"'>"+str_array[i]+"</a>
";
        if (clicked_array[i] == 1) {
            newStr += "</b>";
        }
    }
    content_txt.htmlText = newStr;
}

function clickedOn(num) {
    clicked_array[num] = 1;
    render();
}

render();

// --- Code ends
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to