Flash Action Script Error Repository

A library of solutions to Actionscript, Flash, Flex and AIR

Archive for February, 2010

The default property contents must be contiguous

The default property contents must be contiguous

When in Design View in Flex 4 you must keep the visual design MXML code together. Having a Script block right in the middle of it will create this error.

Incorrect:

XML:
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
  3.                xmlns:s="library://ns.adobe.com/flex/spark"
  4.                xmlns:mx="library://ns.adobe.com/flex/mx">
  5.  
  6.     <!-- Visual markup code -->
  7.     <s:TextInput x="26" y="134" id="code1" width="302" text="Status of Mic"/>
  8.  
  9.     <!-- Script tag interrupts and is located in the middle of visual markup code -->
  10.     <fx:Script>
  11.         <![CDATA[
  12.         private var swfpgno:int = 1;
  13.         ]]>
  14.     </fx:Script>
  15.  
  16.     <!-- Visual markup code -->
  17.     <s:TextInput x="26" y="77" id="mic1" width="302"/>
  18. </s:Application>

Correct:

XML:
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
  3.                xmlns:s="library://ns.adobe.com/flex/spark"
  4.                xmlns:mx="library://ns.adobe.com/flex/mx">
  5.  
  6.     <!-- Script tag does not interrupt flow of design view code -->
  7.     <fx:Script>
  8.         <![CDATA[
  9.         private var swfpgno:int = 1;
  10.         ]]>
  11.     </fx:Script>
  12.  
  13.     <!-- Design View visual markup is in a continuous block -->
  14.     <s:TextInput x="26" y="134" id="code1" width="302" text="Status of Mic"/>
  15.     <s:TextInput x="26" y="77" id="mic1" width="302"/>
  16.  
  17. </s:Application>

No comments