2 Replies Latest reply on Jan 13, 2011 10:54 AM by Gaurav J

    invalid character or markup found in script block. Try surrounding your code with a CDATA block

    _spoboyle Level 4

      I have created the following skin for a custom radio button and get the following error

       

      invalid character or markup found in script block. Try surrounding your code with a CDATA block

       

      however my code is surrounded by a CDATA block not only that but the error persists after I completely delete the script block and clean/build my project

       

      any ideas?

       

      <?xml version="1.0" encoding="utf-8"?>
      
      <!--
      
          ADOBE SYSTEMS INCORPORATED
          Copyright 2008 Adobe Systems Incorporated
          All Rights Reserved.
      
          NOTICE: Adobe permits you to use, modify, and distribute this file
          in accordance with the terms of the license agreement accompanying it.
      
      -->
      
      <!--- The default skin class for the Spark Button component. 
      
             @see spark.components.Button
              
            @langversion 3.0
            @playerversion Flash 10
            @playerversion AIR 1.5
            @productversion Flex 4
      -->
      <s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
                   minWidth="21" minHeight="21"
                   alpha.disabled="0.5">
          
          <fx:Metadata>
              [HostComponent("components.IconRadioButton")]
          </fx:Metadata>
          
          <!-- host component -->
          <fx:Script fb:purpose="styling">
              <![CDATA[
                  /* Define the skin elements that should not be colorized. 
                  For button, the graphics are colorized but the label is not. */
                  static private const exclusions:Array = ["labelDisplay", "ellipse"];
                  
                  /** 
                   * @private
                   */     
                  override public function get colorizeExclusions():Array 
                  {
                      return exclusions;
                  }
                  
                  /**
                   * @private
                   */
                  override protected function initializationComplete():void
                  {
                      icon.source = hostComponent.icon;
                      //ellipse.width = icon.width;
                      //ellipse.height = icon.height;
                      super.initializationComplete();
                  }
                  
                  /**
                   *  @private
                   */
                  override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
                  {                
                      super.updateDisplayList(unscaledWidth, unscaledHeight);
                  }
              ]]>
          </fx:Script>
          
          <!-- states -->
          <s:states>
              <s:State name="up"/>
              <s:State name="over"/>
              <s:State name="down"/>
              <s:State name="disabled"/>
              
              <s:State name="upAndSelected" stateGroups="selectedState"/>
              <s:State name="overAndSelected" stateGroups="selectedState"/>
              <s:State name="downAndSelected" stateGroups="selectedState"/>
              <s:State name="disabledAndSelected" stateGroups="selectedState"/>
          </s:states>
          
          <s:BitmapImage id="icon"/>
          
          <!--- @copy spark.components.supportClasses.ButtonBase#labelDisplay -->
          <s:Label id="labelDisplay"
                   textAlign="center"
                   verticalAlign="middle"
                   maxDisplayedLines="1"
                   horizontalCenter="0" verticalCenter="1"
                   left="10" right="10" top="2" bottom="2">
          </s:Label>
          
          <s:Ellipse id="ellipse" includeIn="selectedState">
              <<s:stroke>
                  <s:SolidColorStroke weight="3" color="#000000"/>
              </s:stroke>
          </s:Ellipse>
          
      </s:SparkSkin>