开发者

AS3 Textfield href ampersand issue

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&param2=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&param2=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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜