A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [RESOLVED] AS2 External contact form issue {HELP}

  1. #1
    Member
    Join Date
    Apr 2008
    Posts
    31

    resolved [RESOLVED] AS2 External contact form issue {HELP}

    hi guys,
    I have a problem that involves an external swf and a contact form, Ive searched goole and couldnt find a solution, so here goes.
    Basically the contact form works fine on its own - send the data etc. However when the form is loaded into an external swf none of the form works. It loads in fine, can see everything apart from the label fields which name the fields: name, email, company etc. I havent got a clue what to do. Any help will be greatly appreciated and will as always bring serious kudos.

    regards

  2. #2
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749
    Just a guess, but I'd say you are probably using _root to reference textfields etc. so the paths are invalid when imported into another movieclip.

  3. #3
    Member
    Join Date
    Apr 2008
    Posts
    31
    here is my code so you can see etc...

    PHP Code:
    function clearField() {
        
    contact1.text label1;
        
    contact2.text label2;
        
    contact3.text label3;
        
    contact4.text label4;
    }
    // End of the function
    label1 "Name";
    label2 "Company";
    label3 "E-mail";
    label4 "Message";
    countField 4;
    clearField();
    var 
    arrayLabel = new Array();
    for (
    i=1i<countField+1i++) {
        
    contact this["contact"+i];
        
    contact.index i;
        
    arrayLabel[i] = this["label"+i];
        
    contact.tabIndex i;
        
    contact.onSetFocus = function() {
            if (
    this.text == arrayLabel[this.index]) {
                
    this.text "";
            }
            
    // end if  
        
    };
        
    contact.onKillFocus = function() {
            if (
    this.text == "") {
                
    this.text arrayLabel[this.index];
            }
            
    // end if  
        
    };
    }
    // end of for




    send_button.onRelease submit;
    reset_button.onRelease reset;
    function 
    submit()
    {
        if( 
    contact1.text == "" || contact3.text == "" ||
            
    contact2.text == "" || contact4.text == "" )
        {
            
    message_status.text "Please fill all text fields.";
        }
        else if( 
    contact3.text.indexOf('@') < || contact3.text.indexOf('.') < )
        {
            
    message_status.text "Please enter a valid email address.";
        }
        else
        {
            
    message_status.text "";
            
    gotoAndStop("send");
        }
    }
    function 
    reset()
    {
        
    contact1.text contact2.text contact3.text =     contact4.text message_status.text "";
        
    clearInterval(interval_id);
        
    gotoAndStop("stop");


  4. #4
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749
    Sorry, I misread your initial post... I thought the thing wasn't working at all.

    If it's just that the text isn't showing, then are you masking the imported movie or rotating it etc.? If so, then Flash needs character outlines to render the text and you'll need to embedFonts.

    Nothing wrong with the code that I could see.

  5. #5
    Member
    Join Date
    Apr 2008
    Posts
    31
    AlsoGaiusCoffey thanks... works a treat, the simpliest answer is always hard to find.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center