5 Replies Latest reply on May 29, 2008 8:05 PM by Noelbaland

    List Component Help!!!

    Brisol
      hi there, i am desperate for some help! im pretty amature at flash!

      ok, im trying to make a mail form and at the moment all the fields work except the list one which comes through in the email as "undefined"! i know this is probably simple but have a look at below and ANY help would be appreciated!!!!!!!

      stop();
      System.useCodepage = true;
      send_btn.onRelease = function() {
      my_vars = new LoadVars();
      my_vars.name = name_box.text;
      my_vars.mail = mail_box.text;
      my_vars.suburb = suburb_box.text;
      my_vars.city = city_box.text;
      my_vars.postcode = postcode_box.text;
      my_vars.phone = phone_box.text;
      my_vars.email = email_box.text;
      my_vars.about = about_box.text;
      my_vars.purchase = purchase_box.text;
      my_vars.product = product_box.text; //??? this is a list, i need it to select but i have no idea how to do this! it just comes through in the email as undefined!
      my_vars.day = day_box.text;
      my_vars.month = month_box.text;
      my_vars.year = year_box.text;
      my_vars.serial = serial_box.text;
      my_vars.product02 = product_box02.text;
      my_vars.day02 = day02_box.text;
      my_vars.month02 = month02_box.text;
      my_vars.year02 = year02_box.text;
      my_vars.serial02 = serial02_box.text;
      if (my_vars.name != "" and my_vars.mail != "" and my_vars.suburb != "") {
      my_vars.sendAndLoad("mailer.php", my_vars, "POST");
      gotoAndStop(2);
      } else {
      error_clip.gotoAndPlay(2);
      }
      my_vars.onLoad = function() {
      gotoAndStop(3);
      };
      };
      email_box.onSetFocus = subject_box.onSetFocus=message_box.onSetFocus=func tion () {
      if (error_clip._currentframe != 1) {
      error_clip.gotoAndPlay(6);
      }
      };

      this is the file: http://www.circularsquare.co.nz/reg.swf

      any help would be fantastic!!!

      :~)

      -Brisol
        • 1. Re: List Component Help!!!
          Noelbaland Level 1
          Hello,

          Try changing

          my_vars.product = product_box.text;

          to this

          my_vars.product = product_box.selectedItem.label;

          See if that works
          • 2. Re: List Component Help!!!
            Brisol Level 1
            Yay!!!

            thankyou! it has removed the "undefined" thing but is coming through as a number (i have value and data defined as something else) also, what would it be for a numeric stepper?

            thankyou for your help! :)

            im so IQ 70
            • 3. Re: List Component Help!!!
              Noelbaland Level 1
              Hello again,

              I actually remebered an easier way to get your data. You use the "value" property of a component. This works with both the ComboBox and Numeric Stepper components

              [ComboBox]
              my_vars.product = product_box.value;

              [Numeric Stepper]
              my_vars.month = month_box.value;

              I think that'll work better than the last post I wrote. Try it and see!

              • 4. Re: List Component Help!!!
                Brisol Level 1
                Thankyou for you help Noelbaland!

                all sorted and working perfect!

                solution as below for future reference:

                stop();
                System.useCodepage = true;
                send_btn.onRelease = function() {
                my_vars = new LoadVars();
                my_vars.name = name_box.text;
                my_vars.mail = mail_box.text;
                my_vars.suburb = suburb_box.text;
                my_vars.city = city_box.text;
                my_vars.postcode = postcode_box.text;
                my_vars.phone = phone_box.text;
                my_vars.email = email_box.text;
                my_vars.about = about_box.text;
                my_vars.purchase = purchase_box.text;
                my_vars.product = product_box.selectedItem.label;
                my_vars.day = day_box.value;
                my_vars.month = month_box.value;
                my_vars.year = year_box.value;
                my_vars.serial = serial_box.text;
                my_vars.product02 = product02_box.selectedItem.label;
                my_vars.day02 = day02_box.value;
                my_vars.month02 = month02_box.value;
                my_vars.year02 = year02_box.value;
                my_vars.serial02 = serial02_box.text;
                if (my_vars.name != "" and my_vars.mail != "" and my_vars.suburb != "") {
                my_vars.sendAndLoad("mailer.php", my_vars, "POST");
                gotoAndStop(2);
                } else {
                error_clip.gotoAndPlay(5);
                }
                my_vars.onLoad = function() {
                gotoAndStop(2);
                };
                };
                email_box.onSetFocus = subject_box.onSetFocus=message_box.onSetFocus=function () {
                if (error_clip._currentframe != 1) {
                error_clip.gotoAndPlay(6);
                }
                };

                • 5. Re: List Component Help!!!
                  Noelbaland Level 1
                  No problemo mate!!

                  Hey I see you're from Christchurch. I'm from Auckland. Great to see some kiwis in this forum!! Nice portfolio by the way!