FLEX ERROR

Child elements specifying default property value must be contiguous

分析:FlashBuilder4的MXML文件上,不能把<fx:Script>...</fx:Script>标签放在其它标签中间,如:
    <s:Button label="aaa"/>  
    <fx:Script>  
        <![CDATA[ 
            protected function button1_clickHandler(event:MouseEvent):void  
            {  
                txt.text ="的确很有flash的风范啊,难怪给改叫FlashBuilder"; 
            } 
        ]]>  
    </fx:Script> 
    <org:FormPanel id="a1" isClickable="true" isClose="false" layout="vertical" >  
        <s:Button label="HAHA" click="button1_clickHandler(event)"/>  
        <mx:Label id="txt" text="速度好像快了很多啊" x="3" y="26"/>  
    </org:FormPanel>  


 I received this error when an event handler I created did not contain an expected parameter. Somehow the compiler missed it but an error was thrown in the browser. The fix was easy. I forgot to add in the event object. Adding that in fixed the problem.

          import flash.events.MouseEvent;
        directorySearch_txt.addEventListener(FocusEvent.FOCUS_OUT,directoryFocusOut); 
          // this line generated no errors in flex but generated errors at run time 
          public function directoryFocusOut():void { 
               // do something    
          } 
          // adding the event object cleared the error 
          public function directoryFocusOut( event:FocusEvent):void {                 // do something               }  

相关文章

一:display:flex布局display:flex是一种布局方式。它即可以...
1. flex设置元素垂直居中对齐在之前的一篇文章中记载过如何...
移动端开发知识点pc端软件和移动端apppc端软件是什么,有哪些...
最近挺忙的,准备考试,还有其他的事,没时间研究东西,快周...
display:flex;把容器设置为弹性盒模型(设置为弹性盒模型之后...
我在网页上运行了一个Flex应用程序,我想使用Command←组合键...