2 Replies Latest reply on May 16, 2009 8:49 PM by TCC-Adobe

    Using Components within a Symbol


      Project. To create a flash box that allows a visitor to enter 1) email 2) phone number 3) preferred method of contact. Then they can hit submit. That information is sent to a php which sends an email to the administrator letting them know to contact someone.


      Reason it is done in flash. I have a "tab" graphic appear and in the tab is the entry form. When they hit submit the information is sent and the tab lowers out of site then raises back up with a confirmation message that the message was sent.


      Problem: The tabs work in annimation. I know that the code works to send information to php and that the php works to send the email. But, my issue is with the GUI. When the flash is rendered, the field boxes do not show up. See image below.

      Picture 5.png

      Setup: To get the fields to move with the tab I have them as separate objects within the symbol of the tab that moves. Could this be the issue? If so, any ideas around this problem?


      AS3 Code:


      1. var request:URLRequest = new URLRequest( "http://mySiteName.com/phpCode.php" );
      2. var variables:URLVariables = new URLVariables();
      3. variables.email = emailAddress;
      4. variables.phone = phoneNumber;
      5. variables.contact = contactBest;
      6. request.data = variables;
      7. request.method = URLRequestMethod.POST;
      8. sendToURL(request);
      PHP Code:
      $emailAddress = $_POST['email'];
      if ($_POST['phone']){
           $phoneNumber = $_POST['phone'];
      $contactBest = $_POST['contact'];
      $subject = "You have a quote request";
      if ($phoneNumber){
           $body = "A visitor with email ".$emailAddress." submitted the form on your web site requesting a painting quote. Their phone number is:                   ".$phoneNumber.". They stated that the best way to contact them would be by ".$contactBest.".";
      }else {
           $body = "A visitor with email ".$emailAddress." submitted the form on your web site requesting a painting quote. They did not provide a                     phone number.";
      if (mail($to, $subject, $body)) {
           echo("Your message was sent");
      } else {
           echo("There was a problem.");
        • 1. Re: Using Components within a Symbol
          Ned Murphy Adobe Community Professional & MVP

          It's not likely the code you show is related to the problem.  If this is an animated piece, are the components appearing at some point or are they there from frame 1 inside the mc?  You may want to put a trace in to see if they reach whatever frame they do display in if so.

          • 2. Re: Using Components within a Symbol
            TCC-Adobe Level 1

            Thank you Ned for that information. I have finally got some time to get back to this project. Here is what I have found. I put a trace on those objects and they are defined as TextInputs and RadioButtons.


            Picture 4.png


            And here is what my Timeline looks like. They are on the form layer and as is shown they animate upward from frame 1 - frame 10. Then in frame 20 the actionscript is called that I have listed previously, as well as a stop(); command. Then when the form is submitted the player proceeds and there is an animation to drop the form layer down and raise a Thank You prompt verifying that the form was submitted. And then in frame 50 another stop(); is called.

            Picture 3.png


            I am just missing why these objects are invisible when the .fla is rendered. Any help is appreciated to get this problem solved.


            I have done preliminary testing to have the form there (no animation in) and when the form is submitted the Thank You slide covers the form. This graphically works, I have not tested the code yet. So, I may have found a round about way to fix the problem. I would still like to know though why when the textInput and RadioButton elements are placed in a graphic to be animated, they disappear.