I have a textfield with an tag in htmlText. Everything works fine until the href contains an ampersand in the url (example: "example.aspx?param1=x¶m2=y"), then flash stop filling the textFie开发者_如何学Cld.
Any solution?
Have you tried :
example.aspx&param1=x&param2=y
?
There is something missing in your code I think , here is a workable example
package
{
import flash.display.Sprite;
import flash.text.TextField;
public class TestTextField extends Sprite
{
private var label:TextField;
private var labelText:String = "<a href=\"example.aspx?param1=x¶m2=y\">link</a><br />";
public function TestTextField()
{
configureLabel();
setLabel(labelText);
}
public function setLabel(str:String):void
{
label.htmlText = str;
}
private function configureLabel():void {
label = new TextField();
addChild(label);
}
}
}
Might be a little late, but in my case, if you replaced the ampersand with %26
(The url encoded version), it showed up just fine.
精彩评论