4 Replies Latest reply on Jun 15, 2011 3:22 PM by GordonSmith

    Problem with a string

    Zolotoj Level 3

      The following string is not going thru compiling:

      public var htmlData:String="<textformat leading='2'><p align='center'><b><font size='20'>HTML Formatted Text</font></b></p></textformat>";

      Error:

      Parse error: '<textformat>' is not allowed to follow '

        • 1. Re: Problem with a string
          GordonSmith Level 4

          Is this in an AS file, or in the <Script> of an MXML file? If it's the latter, you need to use a CDATA block or the < character will be seen as the beginning of a new tag nested inside <Script>.

           

          Gordon Smith

          Adobe Flex SDK Team

          • 2. Re: Problem with a string
            shmonika

            Even if it is in <Script> of an MXML file, I am not getting any parse error while using Flash 4.5 sdk. Its working fine.

             

            Monika

            • 3. Re: Problem with a string
              A.Paul

              In SDK 3.2, it is working.

               

              BTW,

               

              Did u tried the escape character. Below two also works for me.

               

               

              public var htmlData:String="<textformat leading=\'2\'><p align=\'center\'><b><font size=\'20\'>HTML Formatted Text</font></b></p></textformat>";
              public var htmlData:String="<textformat leading=\"2\"><p align=\"center\"><b><font size=\"20\">HTML Formatted Text</font></b></p></textformat>";

              • 4. Re: Problem with a string
                GordonSmith Level 4

                I tried it in 4.5. When I put it in an <fx:Script> and remove the <![CDATA[ and ]]> that Fb automatically inserts, I get the compilation error

                 

                Parse error: '<textformat>' is not allowed to follow '

                Gordon Smith

                Adobe Flex SDK Team

                1 person found this helpful