Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14
  1. #1
    New Coder
    Join Date
    Nov 2011
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts

    getting 1083: Syntax error: else is unexpected

    i am getting this error in my code in flash builder. here is the code i have:

    protected function submit_appointment_clickHandler():void
    {
    var Sender:String = "";
    var Email:String = "";
    var HomePhone:String = "";
    var CellPhone:String = "";
    var Address:String = "";
    var City:String = "";
    var State:String = "";
    var ZipCode:String = "";
    var Comments:String = "";
    var Interests:String = "";
    var Type:String = currentState;

    var evValidEmail: ValidationResultEvent = emailValidator.validate();
    var evValidName: ValidationResultEvent = nameValidator.validate();
    var evValidCellPhone: ValidationResultEvent = cellValidator.validate();
    var evValidHomePhone: ValidationResultEvent = homeValidator.validate();

    if (evValidEmail.type == ValidationResultEvent.VALID
    && evValidName.type == ValidationResultEvent.VALID
    && evValidCellPhone.type == ValidationResultEvent.VALID
    && evValidHomePhone.type == ValidationResultEvent.VALID)

    else{
    resultLabel.text="There are Form errors";
    resultLabel.setStyle("styleName", "invalid");
    }
    }

    any help would be appreciated

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I see a few syntax errors in your code. Try this
    PHP Code:
    protected function submit_appointment_clickHandler():void
    {
        var 
    Sender:String "";
        var 
    Email:String "";
        var 
    HomePhone:String "";
        var 
    CellPhone:String "";
        var 
    Address:String "";
        var 
    City:String "";
        var 
    State:String "";
        var 
    ZipCode:String "";
        var 
    Comments:String "";
        var 
    Interests:String "";
        var 
    Type:String currentState;

        var 
    evValidEmail:ValidationResultEvent emailValidator.validate();
        var 
    evValidName:ValidationResultEvent nameValidator.validate();
        var 
    evValidCellPhone:ValidationResultEvent cellValidator.validate();
        var 
    evValidHomePhone:ValidationResultEvent homeValidator.validate();

        if (
    evValidEmail.type == ValidationResultEvent.VALID
            
    && evValidName.type == ValidationResultEvent.VALID
            
    && evValidCellPhone.type == ValidationResultEvent.VALID
            
    && evValidHomePhone.type == ValidationResultEvent.VALID)
        {
            
    resultLabel.text="Thank you.";
            
    resultLabel.setStyle("styleName""valid");
        }
        else
        {
            
    resultLabel.text="There are Form errors";
            
    resultLabel.setStyle("styleName""invalid");
        }

    Your strict data typing for ValidationResultEvent variables had a space after the : so that wouldn't work. You had an else nested inside of an if which wouldn't work either. The code above should work. If it doesn't give us the line number that the error occurs on as well.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Nov 2011
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts
    i did the changes and that error went went away only to give me another error at another spot. here is the code:

    i put a mad face on the line where i am getting the error

    1087: Syntax error: extra characters found after end of program.


    protected function submit_appointment_clickHandler():void
    {
    var Sender:String = "";
    var Email:String = "";
    var HomePhone:String = "";
    var CellPhone:String = "";
    var Address:String = "";
    var City:String = "";
    var State:String = "";
    var ZipCode:String = "";
    var Comments:String = "";
    var Interests:String = "";
    var Type:String = currentState;

    var evValidEmail:ValidationResultEvent = emailValidator.validate();
    var evValidName:ValidationResultEvent = nameValidator.validate();
    var evValidCellPhone:ValidationResultEvent = cellValidator.validate();
    var evValidHomePhone:ValidationResultEvent = homeValidator.validate();

    if (evValidEmail.type == ValidationResultEvent.VALID
    && evValidName.type == ValidationResultEvent.VALID
    && evValidCellPhone.type == ValidationResultEvent.VALID
    && evValidHomePhone.type == ValidationResultEvent.VALID)
    {
    resultLabel.text="Thank you.";
    resultLabel.setStyle("styleName", "valid");
    }
    else
    {
    resultLabel.text="There are Form errors";
    resultLabel.setStyle("styleName", "invalid");
    }
    }

    switch(currentState)
    {
    case "appointment":
    Sender = txtApptFirstName.text + " " + txtApptLastName.text;
    Email = txtApptEmail.text;
    HomePhone = txtApptHomePhone.text;
    CellPhone = txtApptCellPhone.text;
    Address = txtApptAddress.text;
    City = txtApptCity.text;
    State = txtApptState.text;
    ZipCode = txtApptZipCode.text;
    Comments = txtApptComments.text;
    if(chkApptPhotography.selected) Interests = Interests + " Photography Session ";
    if(chkApptChildrenFamily.selected) Interests = Interests + " Children and Family Portraits ";
    if(chkApptPromSchool.selected) Interests = Interests + " Prom and School Event Photos ";
    if(chkApptSeniorSchool.selected) Interests = Interests + " Senior School Photos ";
    break;
    case "contact":
    Sender = txtContactFirstName.text + " " + txtContactLastName.text;
    Email = txtContactEmail.text;
    HomePhone = txtContactHomePhone.text;
    CellPhone = txtContactCellPhone.text;
    Address = txtContactAddress.text;
    City = txtContactCity.text;
    State = txtContactState.text;
    ZipCode = txtContactZipCode.text;
    Comments = txtContactComments.text;
    if(chkContactPhotography.selected) Interests = Interests + " Photography Session ";
    if(chkContactChildrenFamily.selected) Interests = Interests + " Children and Family Portraits ";
    if(chkContactPromSchool.selected) Interests = Interests + " Prom and School Event Photos ";
    if(chkContactSeniorSchool.selected) Interests = Interests + " Senior School Photos ";
    break;
    case "free_shoot":
    Sender = txtFreeFirstName.text + " " + txtFreeLastName.text;
    Email = txtFreeEmail.text;
    HomePhone = txtFreeHomePhone.text;
    CellPhone = txtFreeCellPhone.text;
    Comments = txtFreeComments.text;
    break;
    }

    emailService.send(
    {
    senderName: Sender,
    senderEmail: Email,
    senderHomePhone: HomePhone,
    senderCellPhone: CellPhone,
    senderAddress: Address,
    senderCity: City,
    senderState: State,
    senderZipCode: ZipCode,
    senderComments: Comments,
    senderInterests: Interests,
    sendType: Type
    });
    }


    private function emailResult():void
    {
    Alert.show("Thank you for your submission. You will contacted shortly.");
    clearForm();
    }


    private function clearForm():void
    {
    txtFreeFirstName.text="";
    txtFreeLastName.text="";
    txtFreeEmail.text="";
    txtFreeHomePhone.text="";
    txtFreeCellPhone.text="";
    txtFreeComments.text="";

    txtApptFirstName.text="";
    txtApptLastName.text="";
    txtApptEmail.text="";
    txtApptHomePhone.text="";
    txtApptCellPhone.text="";
    txtApptAddress.text="";
    txtApptCity.text="";
    txtApptState.text="";
    txtApptZipCode.text="";
    txtApptComments.text="";
    chkApptPhotography;
    chkApptChildrenFamily;
    chkApptPromSchool;
    chkApptSeniorSchool;

    txtContactFirstName.text="";
    txtContactLastName.text="";
    txtContactEmail.text="";
    txtContactHomePhone.text="";
    txtContactCellPhone.text="";
    txtContactAddress.text="";
    txtContactCity.text="";
    txtContactState.text="";
    txtContactZipCode.text="";
    txtContactComments.text="";
    chkContactPhotography;
    chkContactChildrenFamily;
    chkContactPromSchool;
    chkContactSeniorSchool;
    }
    Last edited by akuria; 11-06-2011 at 07:12 PM.

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I didn't know you had more code. It helps to post all of your code. In the future please do so. Remove the last } after this
    PHP Code:
    if (evValidEmail.type == ValidationResultEvent.VALID
    && evValidName.type == ValidationResultEvent.VALID
    && evValidCellPhone.type == ValidationResultEvent.VALID
    && evValidHomePhone.type == ValidationResultEvent.VALID)
    {
    resultLabel.text="Thank you.";
    resultLabel.setStyle("styleName""valid");
    }
    else
    {
    resultLabel.text="There are Form errors";
    resultLabel.setStyle("styleName""invalid");
    }

    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New Coder
    Join Date
    Nov 2011
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts
    now i am getting error messages at the resultLabel lines (x4) here is my entire bit of code so no hopefully no more errors. lol. thanks for the info and help so far.

    1120: Access of undefined property resultLabel.

    PHP Code:
    <fx:Script>
            <![
    CDATA[
                
    import mx.collections.ArrayCollection;
                
    import mx.controls.Alert;
                
    import mx.events.FlexEvent;
                
    import mx.events.ValidationResultEvent;
                
    import mx.rpc.events.FaultEvent;
                
    import mx.rpc.events.ResultEvent;
                
    import mx.rpc.soap.SOAPFault;
                
    import mx.rpc.soap.WebService;
                protected function 
    button_clickHandler():void
                
    {
                    
    currentState='home';
                    
    Sequence1.play();
                }
                protected function 
    button_clickHandler_2():void
                
    {
                    
    currentState='contact';
                }
                protected function 
    button_clickHandler_1():void
                
    {
                    
    currentState='about_team';
                }
                protected function 
    button_clickHandler_14():void
                
    {
                    
    currentState='about_what';
                }
                protected function 
    button_clickHandler_15():void
                
    {
                    
    currentState='about_who';
                }
                protected function 
    button_clickHandler_16():void
                
    {
                    
    currentState='about_team';
                }
                protected function 
    button_clickHandler_19():void
                
    {
                    
    currentState='appointment';
                }
                protected function 
    button_clickHandler_20():void
                
    {
                    
    currentState='service';
                }
                protected function 
    button_clickHandler_21():void
                
    {
                    
    navigateToURL( new URLRequestencodeURI("http://protegefoundation.org")), "_blank");
                }
                protected function 
    button_clickHandler_24():void
                
    {
                    
    currentState='testimonial';
                }
                protected function 
    button_clickHandler_25():void
                
    {
                    
    currentState='charity';
                }
                protected function 
    button_clickHandler_3():void
                
    {
                    
    currentState='studio_tour';
                    
    Sequence4.play();
                }
                protected function 
    button_clickHandler_4():void
                
    {
                    
    currentState='galleries';
                }
                protected function 
    button_clickHandler_7():void
                
    {
                    
    currentState='packages';
                }
                protected function 
    button_clickHandler_8():void
                
    {
                    
    currentState='shop';
                }
                protected function 
    button_clickHandler_17():void
                
    {
                    
    currentState='free_shoot';
                }
                protected function 
    button_clickHandler_18():void
                
    {
                    
    currentState='appointment';
                }


            


            


            


            


            


            


            


                protected function 
    submit_appointment_clickHandler():void
                
    {
                    var 
    Sender:String "";
                    var 
    Email:String "";
                    var 
    HomePhone:String "";
                    var 
    CellPhone:String "";
                    var 
    Address:String "";
                    var 
    City:String "";
                    var 
    State:String "";
                    var 
    ZipCode:String "";
                    var 
    Comments:String "";
                    var 
    Interests:String "";
                    var 
    Type:String currentState;
                    
                    var 
    evValidEmail:ValidationResultEvent emailValidator.validate();
                    var 
    evValidName:ValidationResultEvent nameValidator.validate();
                    var 
    evValidCellPhone:ValidationResultEvent cellValidator.validate();
                    var 
    evValidHomePhone:ValidationResultEvent homeValidator.validate();
                    
                    if (
    evValidEmail.type == ValidationResultEvent.VALID
                        
    && evValidName.type == ValidationResultEvent.VALID
                        
    && evValidCellPhone.type == ValidationResultEvent.VALID
                        
    && evValidHomePhone.type == ValidationResultEvent.VALID)
                    {
                        
    resultLabel.text="Thank you.";
                        
    resultLabel.setStyle("styleName""valid");
                    }
                    else
                    {
                        
    resultLabel.text="There are Form errors";
                        
    resultLabel.setStyle("styleName""invalid");
                    }
                
                switch(
    currentState)
                {
                    case 
    "appointment":
                        
    Sender txtApptFirstName.text " " txtApptLastName.text;
                        
    Email txtApptEmail.text;
                        
    HomePhone txtApptHomePhone.text;
                        
    CellPhone txtApptCellPhone.text;
                        
    Address txtApptAddress.text;
                        
    City txtApptCity.text;
                        
    State txtApptState.text;
                        
    ZipCode txtApptZipCode.text;
                        
    Comments txtApptComments.text;
                        if(
    chkApptPhotography.selectedInterests Interests " Photography Session ";
                        if(
    chkApptChildrenFamily.selectedInterests Interests " Children and Family Portraits ";
                        if(
    chkApptPromSchool.selectedInterests Interests " Prom and School Event Photos ";
                        if(
    chkApptSeniorSchool.selectedInterests Interests " Senior School Photos ";
                        break;
                    case 
    "contact":
                        
    Sender txtContactFirstName.text " " txtContactLastName.text;
                        
    Email txtContactEmail.text;
                        
    HomePhone txtContactHomePhone.text;
                        
    CellPhone txtContactCellPhone.text;
                        
    Address txtContactAddress.text;
                        
    City txtContactCity.text;
                        
    State txtContactState.text;
                        
    ZipCode txtContactZipCode.text;
                        
    Comments txtContactComments.text;
                        if(
    chkContactPhotography.selectedInterests Interests " Photography Session ";
                        if(
    chkContactChildrenFamily.selectedInterests Interests " Children and Family Portraits ";
                        if(
    chkContactPromSchool.selectedInterests Interests " Prom and School Event Photos ";
                        if(
    chkContactSeniorSchool.selectedInterests Interests " Senior School Photos ";
                        break;
                    case 
    "free_shoot":
                        
    Sender txtFreeFirstName.text " " txtFreeLastName.text;
                        
    Email txtFreeEmail.text;
                        
    HomePhone txtFreeHomePhone.text;
                        
    CellPhone txtFreeCellPhone.text;
                        
    Comments txtFreeComments.text;
                        break;
                }    

                
    emailService.send(
                    {
                        
    senderNameSender,
                        
    senderEmailEmail,
                        
    senderHomePhoneHomePhone,
                        
    senderCellPhoneCellPhone,
                        
    senderAddressAddress,
                        
    senderCityCity,
                        
    senderStateState,
                        
    senderZipCodeZipCode,
                        
    senderCommentsComments,
                        
    senderInterestsInterests,
                        
    sendTypeType
                    
    });
            }
                

                private function 
    emailResult():void
                
    {
                    
    Alert.show("Thank you for your submission. You will contacted shortly.");
                    
    clearForm();
                }

                
                private function 
    clearForm():void
                
    {
                    
    txtFreeFirstName.text="";
                    
    txtFreeLastName.text="";
                    
    txtFreeEmail.text="";
                    
    txtFreeHomePhone.text="";
                    
    txtFreeCellPhone.text="";
                    
    txtFreeComments.text="";

                    
    txtApptFirstName.text="";
                    
    txtApptLastName.text="";
                    
    txtApptEmail.text="";
                    
    txtApptHomePhone.text="";
                    
    txtApptCellPhone.text="";
                    
    txtApptAddress.text="";
                    
    txtApptCity.text="";
                    
    txtApptState.text="";
                    
    txtApptZipCode.text="";
                    
    txtApptComments.text="";
                    
    chkApptPhotography;
                    
    chkApptChildrenFamily;
                    
    chkApptPromSchool;
                    
    chkApptSeniorSchool;

                    
    txtContactFirstName.text="";
                    
    txtContactLastName.text="";
                    
    txtContactEmail.text="";
                    
    txtContactHomePhone.text="";
                    
    txtContactCellPhone.text="";
                    
    txtContactAddress.text="";
                    
    txtContactCity.text="";
                    
    txtContactState.text="";
                    
    txtContactZipCode.text="";
                    
    txtContactComments.text="";
                    
    chkContactPhotography;
                    
    chkContactChildrenFamily;
                    
    chkContactPromSchool;
                    
    chkContactSeniorSchool;
                }
        
                
                
            protected function 
    button_clickHandler_5():void
            
    {
                
    currentState='career';
            }


            protected function 
    button_clickHandler_6():void
            
    {
                
    navigateToURL( new URLRequestencodeURI("mailto:info@protege.tv")), "_self");
            }


            protected function 
    button_clickHandler_9():void
            
    {
                    
    navigateToURL( new URLRequestencodeURI("http://protege.tv/pdf/PROTEGE_MAP_DIRECTION.pdf")), "_self");
                }


            protected function 
    button_clickHandler_10():void
            
    {
                
    currentState='map';
            }


            protected function 
    swfcontroller2_completeHandler(event:Event):void
            
    {
                
    Sequence4.play();
            }
                
            protected function 
    swfcontroller1_completeHandler(event:Event):void
            
    {
                
    Sequence1.play();
            }    

                ]]></
    fx:Script>
        <
    s:states>
            <
    s:State fc:color="0xcc0000" name="home"/>
            <
    s:State fc:color="0x0081cc" name="contact"/>
            <
    s:State fc:color="0x00cc21" name="about_team"/>
            <
    s:State fc:color="0xa30017" name="about_what"/>
            <
    s:State fc:color="0x08ffb6" name="about_who"/>
            <
    s:State fc:color="0x510900" name="free_shoot"/>
            <
    s:State fc:color="0xbbcc00" name="appointment"/>
            <
    s:State fc:color="0x9308ff" name="service"/>
            <
    s:State fc:color="0x157100" name="charity"/>
            <
    s:State fc:color="0xa30096" name="testimonial"/>
            <
    s:State fc:color="0x00a38e" name="studio_tour"/>
            <
    s:State fc:color="0xfe4f8d" name="packages"/>
            <
    s:State fc:color="0xcca3ff" name="galleries"/>
            <
    s:State fc:color="0xcc0000" name="shop"/>
            <
    s:State name="career"/>
            <
    s:State name="map"/>
        </
    s:states>
        <
    fx:Declarations>
            <
    mx:HTTPService id="emailService" 
                            
    url="sendEmail.php"
                            
    method="POST"
                            
    resultFormat="xml"
                            
    result="emailResult()" 
                            
    useProxy="false"/>
            <
    mx:EmailValidator id="emailValidator"
                               
    source="{txtFreeEmail, txtApptEmail, txtContactEmail}" property="text"
                               
    requiredFieldError="Enter your email" required="true" />
            <
    mx:StringValidator id="nameValidator"
                                
    source="{txtFreeFirstName, txtFreeLastName, txtApptFirstName, txtApptLastName, txtContactFirstName, txtContactLastName}" property="text"
                                
    requiredFieldError="Enter your name" required="true"/>
            <
    mx:StringValidator id="cellValidator"
                                
    source="{txtFreeCellPhone, txtApptCellPhone, txtContactCellPhone}" property="text"
                                
    requiredFieldError="Enter your cell phone number" required="true"/>
            <
    mx:StringValidator id="homeValidator"
                                
    source="{txtFreeHomePhone, txtApptHomePhone, txtContactHomePhone}" property="text"
                                
    requiredFieldError="Enter your home phone number" required="true"/>
            <
    s:Parallel id="Sequence1">
                <
    s:Parallel target="{swfcontroller1}">
                    <
    s:CallAction functionName="playSWF"/>
                </
    s:Parallel>
            </
    s:Parallel>
            <
    s:Parallel id="Sequence3">
            </
    s:Parallel>
            <
    s:Parallel id="Sequence4">
                <
    s:Parallel target="{swfcontroller2}">
                    <
    s:CallAction functionName="playSWF"/>
                </
    s:Parallel>
            </
    s:Parallel>
        </
    fx:Declarations

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Read the error. It is telling you exactly what the problem is. Where is resultLabel defined?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    New Coder
    Join Date
    Nov 2011
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    Read the error. It is telling you exactly what the problem is. Where is resultLabel defined?
    duh! thanks. i added the define line of code and no errors but its not working.

    PHP Code:
    <mx:Label id="resultLabel"/> 
    i added this line of code to the declarations area of the code.

  • #8
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Okay that is fine and all but what are you going to do with it? You haven't added it to the timeline or anything.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #9
    New Coder
    Join Date
    Nov 2011
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    Okay that is fine and all but what are you going to do with it? You haven't added it to the timeline or anything.
    what do you mean? sorry i am a noob to flex.

  • #10
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Where are you using resultLabel? You aren't displaying it anywhere.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #11
    New Coder
    Join Date
    Nov 2011
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    Where are you using resultLabel? You aren't displaying it anywhere.
    this is where i am using the resultLabel.

    PHP Code:
    protected function submit_appointment_clickHandler():void
                
    {
                    var 
    Sender:String "";
                    var 
    Email:String "";
                    var 
    HomePhone:String "";
                    var 
    CellPhone:String "";
                    var 
    Address:String "";
                    var 
    City:String "";
                    var 
    State:String "";
                    var 
    ZipCode:String "";
                    var 
    Comments:String "";
                    var 
    Interests:String "";
                    var 
    Type:String currentState;
                    
                    var 
    evValidEmail:ValidationResultEvent emailValidator.validate();
                    var 
    evValidName:ValidationResultEvent nameValidator.validate();
                    var 
    evValidCellPhone:ValidationResultEvent cellValidator.validate();
                    var 
    evValidHomePhone:ValidationResultEvent homeValidator.validate();
                    
                    if (
    evValidEmail.type == ValidationResultEvent.VALID
                        
    && evValidName.type == ValidationResultEvent.VALID
                        
    && evValidCellPhone.type == ValidationResultEvent.VALID
                        
    && evValidHomePhone.type == ValidationResultEvent.VALID)
                    {
                        
    resultLabel.text="Thank you.";
                        
    resultLabel.setStyle("styleName""valid");
                    }
                    else
                    {
                        
    resultLabel.text="There are Form errors";
                        
    resultLabel.setStyle("styleName""invalid");
                    }
                
                switch(
    currentState)
                {
                    case 
    "appointment":
                        
    Sender txtApptFirstName.text " " txtApptLastName.text;
                        
    Email txtApptEmail.text;
                        
    HomePhone txtApptHomePhone.text;
                        
    CellPhone txtApptCellPhone.text;
                        
    Address txtApptAddress.text;
                        
    City txtApptCity.text;
                        
    State txtApptState.text;
                        
    ZipCode txtApptZipCode.text;
                        
    Comments txtApptComments.text;
                        if(
    chkApptPhotography.selectedInterests Interests " Photography Session ";
                        if(
    chkApptChildrenFamily.selectedInterests Interests " Children and Family Portraits ";
                        if(
    chkApptPromSchool.selectedInterests Interests " Prom and School Event Photos ";
                        if(
    chkApptSeniorSchool.selectedInterests Interests " Senior School Photos ";
                        break;
                    case 
    "contact":
                        
    Sender txtContactFirstName.text " " txtContactLastName.text;
                        
    Email txtContactEmail.text;
                        
    HomePhone txtContactHomePhone.text;
                        
    CellPhone txtContactCellPhone.text;
                        
    Address txtContactAddress.text;
                        
    City txtContactCity.text;
                        
    State txtContactState.text;
                        
    ZipCode txtContactZipCode.text;
                        
    Comments txtContactComments.text;
                        if(
    chkContactPhotography.selectedInterests Interests " Photography Session ";
                        if(
    chkContactChildrenFamily.selectedInterests Interests " Children and Family Portraits ";
                        if(
    chkContactPromSchool.selectedInterests Interests " Prom and School Event Photos ";
                        if(
    chkContactSeniorSchool.selectedInterests Interests " Senior School Photos ";
                        break;
                    case 
    "free_shoot":
                        
    Sender txtFreeFirstName.text " " txtFreeLastName.text;
                        
    Email txtFreeEmail.text;
                        
    HomePhone txtFreeHomePhone.text;
                        
    CellPhone txtFreeCellPhone.text;
                        
    Comments txtFreeComments.text;
                        break;
                }    

                
    emailService.send(
                    {
                        
    senderNameSender,
                        
    senderEmailEmail,
                        
    senderHomePhoneHomePhone,
                        
    senderCellPhoneCellPhone,
                        
    senderAddressAddress,
                        
    senderCityCity,
                        
    senderStateState,
                        
    senderZipCodeZipCode,
                        
    senderCommentsComments,
                        
    senderInterestsInterests,
                        
    sendTypeType
                    
    });
            } 
    and here is where i am declaring it

    PHP Code:
    <fx:Declarations>
    <
    mx:Label id="resultLabel"/> 
            <
    mx:HTTPService id="emailService" 
                            
    url="sendEmail.php"
                            
    method="POST"
                            
    resultFormat="xml"
                            
    result="emailResult()" 
                            
    useProxy="false"/>
            <
    mx:EmailValidator id="emailValidator"
                               
    source="{txtFreeEmail, txtApptEmail, txtContactEmail}" property="text"
                               
    requiredFieldError="Enter your email" required="true" />
            <
    mx:StringValidator id="nameValidator"
                                
    source="{txtFreeFirstName, txtFreeLastName, txtApptFirstName, txtApptLastName, txtContactFirstName, txtContactLastName}" property="text"
                                
    requiredFieldError="Enter your name" required="true"/>
            <
    mx:StringValidator id="cellValidator"
                                
    source="{txtFreeCellPhone, txtApptCellPhone, txtContactCellPhone}" property="text"
                                
    requiredFieldError="Enter your cell phone number" required="true"/>
            <
    mx:StringValidator id="homeValidator"
                                
    source="{txtFreeHomePhone, txtApptHomePhone, txtContactHomePhone}" property="text"
                                
    requiredFieldError="Enter your home phone number" required="true"/>
            <
    s:Parallel id="Sequence1">
                <
    s:Parallel target="{swfcontroller1}">
                    <
    s:CallAction functionName="playSWF"/>
                </
    s:Parallel>
            </
    s:Parallel>
            <
    s:Parallel id="Sequence3">
            </
    s:Parallel>
            <
    s:Parallel id="Sequence4">
                <
    s:Parallel target="{swfcontroller2}">
                    <
    s:CallAction functionName="playSWF"/>
                </
    s:Parallel>
            </
    s:Parallel>
        </
    fx:Declarations

  • #12
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I guess I'm not too familiar with how flex apps work. Don't you have to tell flex where to display the label?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #13
    New Coder
    Join Date
    Nov 2011
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I don't know. I guess that's why i am asking.

  • #14
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    You don't put display elements in the Declarations tag like that; they would go in a Group/HGroup/VGroup that is your main content body, or some other element you are adding. The Declarations tag is for non-visible elements like services, validators, and effects.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •