Flex 4:The default property contents must be contiguous

In Flash Builder 4, when tried to create a MXML component and instantiate it in the main MXML application, I found that the "Outline" explorer is not displaying the correct tree view anymore, instead it displayed excalmatory marks for each of the components' icon:


And when I switched to the design view in the MXML editor, it failed to render the preview and showed an error message "The default property contents must be contiguous":


However, when I compiled and run the application, everything looked OK. I think this was just an error for the Flash Builder 4 failing to parse and render the outline and preview. The code which was generating such error looks like this:

Code - MXML Plain Text
 
  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.                xmlns:components="components.*">  
  6.     <fx:Declarations>  
  7.         <!-- Place non-visual elements (e.g., services, value objects) here -->  
  8.     </fx:Declarations>  
  9.       
  10.     <s:layout>  
  11.         <s:VerticalLayout horizontalAlign="center" paddingTop="20"/>  
  12.     </s:layout>  
  13.       
  14.     <!-- shorthand MXML bindings -->  
  15.     <s:TextInput id="sourceText" text="some value"/>  
  16.     <s:Label text="{sourceText.text}"/>  
  17.           
  18.     <!-- two-way bindings -->  
  19.     <s:TextInput id="input1" text="@{input2.text}"/>  
  20.     <s:TextInput id="input2"/>  
  21.       
  22.       
  23.     <!-- Using <fx:Binding> -->  
  24.     <s:TextInput id="sourceText2" text="some value 2"/>  
  25.     <s:Label id="destinationText"/>  
  26.     <fx:Binding source="sourceText2.text" destination="destinationText.text"/>  
  27.       
  28.     <!-- Instantiate a MXML component -->  
  29.     <components:MyComponent id="comp1"/>  
  30. </s:Application>  


As the error message said, the visual componets (default property contents) must  be contiguous. So I tried to move the "fx:Binding" tag to just behind the "fx:Declaration" tag, then the error went away.

Code - XML/HTML Plain Text
 
  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.                xmlns:components="components.*">  
  6.     <fx:Declarations>  
  7.         <!-- Place non-visual elements (e.g., services, value objects) here -->  
  8.     </fx:Declarations>  
  9.     <fx:Binding source="sourceText2.text" destination="destinationText.text"/>  
  10.       
  11.     <s:layout>  
  12.         <s:VerticalLayout horizontalAlign="center" paddingTop="20"/>  
  13.     </s:layout>  
  14.       
  15.     <!-- shorthand MXML bindings -->  
  16.     <s:TextInput id="sourceText" text="some value"/>  
  17.     <s:Label text="{sourceText.text}"/>  
  18.           
  19.     <!-- two-way bindings -->  
  20.     <s:TextInput id="input1" text="@{input2.text}"/>  
  21.     <s:TextInput id="input2"/>  
  22.           
  23.     <!-- Using <fx:Binding> -->  
  24.     <s:TextInput id="sourceText2" text="some value 2"/>  
  25.     <s:Label id="destinationText"/>  
  26.       
  27.     <!-- Instantiate a MXML component -->  
  28.     <components:MyComponent id="comp1"/>  
  29. </s:Application>  




Note that the "s:layout" from the spark library is also a non-visual component, so it can't be placed between any of the visual components neither, otherwise the same error would occur.

 

from:http://www.inluck.net/Blog/Flash-Builder-4-error-The-default-property-contents-must-be-contiguous

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值