2 Replies Latest reply on Aug 13, 2009 1:10 PM by Mainmanian

    Parse error

    Mainmanian Level 1

      In my application, I have a registration form for users and before the users can register, they need to accept Terms and Conditions. In my attempt to code that piece, I am encountering a Parse Error. I am unable to get beyond this. Can someone please help explain why I am getting this error and what to do to fix it? The code is attached below. The Parse Error is at the sole line in the init() routine. Thanks

      --------------------------------------------------------------------------

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
           backgroundColor="#B5B3C1"
           paddingRight="0" paddingBottom="0"
           horizontalScrollPolicy="off"
           verticalScrollPolicy="off"
           width="488" height="245"
           initialize="init()">
          
         <mx:Script>

       

              private function init():void {
                   this.tAndCText.htmlText = "I have read and agree to the <a href='event:terms'>Terms and Conditions</a> of the site";
              }
              private function registerUser(event:Event):void {
                  if (termsAndConditionsCheckBox.selected) {
                      this.errorMessage.text = "OK";
                  } else {
                      this.errorMessage.text = "Not OK";
                  }
                }
              private function checkBoxLink(event:TextEvent):void{
                  trace("Event triggered");
              }
          </mx:Script>
      <mx:Form>
          <mx:FormHeading label="Sign up for myApp" horizontalCenter="left" textAlign="left"  fontFamily="Calibri" fontSize="14" width="166"/>
          <mx:FormItem label="Email" horizontalAlign="right" fontWeight="bold" fontFamily="Calibri" fontSize="12">
              <mx:TextInput id="user_id" toolTip="Your email address"/>
          </mx:FormItem>
          <mx:FormItem label="Full Name" fontWeight="bold" fontFamily="Calibri" fontSize="12">
              <mx:TextInput id="user_name"/>
          </mx:FormItem>
          <mx:FormItem label="I am" width="370" fontWeight="bold" fontFamily="Calibri" fontSize="12">
              <mx:ComboBox width="101" id="sex">
                  <mx:dataProvider>
                      <mx:Array>
                          <mx:String>Male</mx:String>
                          <mx:String>Female</mx:String>
                      </mx:Array>
                  </mx:dataProvider>
              </mx:ComboBox>
          </mx:FormItem>
          <mx:Grid>
              <mx:GridRow width="100%" height="100%">
                  <mx:GridItem width="370" height="100%" paddingLeft="0" horizontalAlign="right">
                      <mx:CheckBox label="" id="termsAndConditionsCheckBox"/>
                      <mx:Text id="tAndCText" link="checkBoxLink(event)" height="22"/>
                      <mx:Spacer width="100%"/>
                      <mx:Button label="Sign Up"
                          id="registerBTN"
                          click="registerUser(event)"
                          fillAlphas="[1.0, 1.0]" fillColors="[#EFE215, #D91A1A]"
                          fontFamily="Calibri" fontSize="12"/>
                  </mx:GridItem>
              </mx:GridRow>
          </mx:Grid>    
          <mx:Label text="Error message" color="#DD2E0B" fontFamily="Arial"  id="errorMessage" fontWeight="bold" fontSize="12"  width="381"/>
      </mx:Form>  

       

      </mx:Application>