9 Replies Latest reply on Nov 19, 2007 4:33 PM by Newsgroup_User

    MOVIE CLIP

    Mary_Alice Level 1
      Once I select all the input fields along with titles, I create the new movieclip and name it form. This will be the form movieclip. And do I check 'Export for Actionscript' in the linkage area? Perhaps, I did not do that prior.
        • 1. Re: MOVIE CLIP
          Mary_Alice Level 1
          I made the form into a movie clip, gave instance name: form and checked export for actionscript and export in first frame. Hope that is correct.
          • 2. Re: MOVIE CLIP
            Level 7
            Mary Alice,

            > I made the form into a movie clip, gave instance name: form
            > and checked export for actionscript and export in first frame.
            > Hope that is correct.

            My hunch is that you're referring to the EcoWater mail form, a topic
            that kglad, clbeech, dzeward, and I have all offered suggestions on over the
            last few days. The problem is, you haven't been replying to the same thread
            as you've posted new questions. That ends up scattering both the questions
            and replies to your scenario all over the forums. Rather than entering a
            cohesive converation, anyone replying to one of your threads ends up
            entering only a fragment of the conversation, which makes it more difficult
            for people to offer you help.

            Already, for example, I find it hard to determine how far you've
            advanced toward your goal, because I have to actively flip among half a
            dozen threads to catch up -- to see who has offered what advice, how you've
            digested the information, and so on.

            Ideally, you should choose a thread and stick with that one. That
            thread should have a subject line that describes the issue it pertains to
            (e.g. "PHP mail form issue with Flash," rather than "To Beech and Glad");
            make sense? That way, all four of us -- and possibly more -- can help you
            in an easy-to-follow manner.


            David Stiller
            Co-author, Foundation Flash CS3 for Designers
            http://tinyurl.com/2k29mj
            "Luck is the residue of good design."


            • 3. Re: MOVIE CLIP
              Sketchsta Level 1
              Hi Mary,
              I havent had time to look through ALLL your threads, but i did see this one and the previous, where David gave you wisdom, you should re-read his post, it has ALOT of useful notes in there about Flash and Actionscript.

              Anyway, from reading David's post i got a fair idea of what your troubles are, so im gonna tell you what Dave told you to do.

              you said you made a movieClip out of all your text fields, this is a good thing. You said you gave it an instance name of "form", a good thing also.
              ( just a side note...you do NOT need to export for Actionscript....This is only required if you plan on attaching your movieClip via actionscript at runtime)

              Dave said your SUBMIT button is located on the main timeline (_root)...
              here is what you do..

              when you tell my_lv (loadVars) where your text is located, you MUST specify the whole "address" of where they are. In your case, the text fileds are located inside a movieClip called "form" which is located on the main timeline "_root"

              so your code will look something like this..

              _root.form.house_text.text = " ";

              this is an ABSOLUTE path to your text fields, this will work.
              Notice you are specifying the Main Timeline first, then your MovieClip symbol that holds your text Fields, then you are calling each text field by it's instance name.

              Hope this sheds some light on your "undefined" inputs.

              P.S..
              might I suggest that you pick 1 thread and stick to it. Instead of creating a new Thread everytime you ask a question.
              I makes it ALOT easier for others to know what the whole problem is, and to help you.

              Good Luck. I know from experience how annoying Forms can be. =P
              • 4. Re: MOVIE CLIP
                Mary_Alice Level 1
                No longer on the same timeline. All are on their on timeline. Form on form's timeline and submit and submit's timeline.

                See url: http://www.ecowaterpb.com/fla%2c%20php.zip

                The thank you still does not appear and the typed information that comes is of undefined.
                Looks like this:

                water supply: undefined
                softener: undefined
                bottled water: undefined
                comments: undefined
                name/business: undefined
                street: undefined
                city, state, zip: undefined
                phone: undefinedemail: undefined

                From: <undefined>
                Reply-To: undefined
                Return-Path: undefined
                • 5. Re: MOVIE CLIP
                  Level 7
                  Mary Alice,

                  > No longer on the same timeline. All are on their on timeline.

                  I'm somewhat unclear on what this means. From what I saw, the text
                  fields never were on the same timeline -- but I might have missed that. As
                  it is, the text fields are currently wrapped up inside a movie clip, which
                  indeed means they're on their own timeline. So far, so good. And
                  ultimately, that's neither here nor there -- as long as the code associated
                  with your button knows how to *reach* the text fields, wherever they are.
                  That's the key.

                  The text fields now have instance names, but they're still being
                  associated with timeline variables via the Var field of the Property
                  inspector. My hunch is that this may confuse matters for you, Mary Alice,
                  because in a sense, each text field is now associated with two variables:
                  a) its associated Var variable and b) its TextField.text property.

                  The movie clip that contains these text fields -- at this point in
                  time -- still doesn't have an instance name.

                  At this point, the LoadVars properties inside the Submit button go like
                  this:

                  my_lv.household = household_txt.text;

                  ... which means the button is looking for an object with the instance name
                  household_txt. That's good, because the corresponding text field now *has*
                  that instance name. BUT, that instance name is not visible from the point
                  of view of that button.

                  During my last reply, I mentioned that button symbols differ in their
                  interpretation of the "this" keyword depending on whether or not on() is
                  being used. When I answered that, I was mistakenly thinking that the Submit
                  button was a button symbol. As it turns out, this is an instance of the v2
                  Button control, which means scoping is handled the same as if this were a
                  movie clip.

                  In short, the button is looking into its own timeline for something
                  called household_txt and isn't able to find it. Because this is a Button UI
                  control, it will have to look for something like this instead:

                  this._parent.form_mc.my_lv.household = household_txt.text;

                  ... which assumes the container movie clip has the instance name form_mc.
                  If this was a button symbol, as I thought before, that path would be this:

                  this.form_mc.my_lv.household = household_txt.text;

                  ... (without the _parent reference, because of what I explained earlier).

                  At this point, I'm not sure how (or where) to keep replying to your
                  posts, Mary Alice. For all I know, you might have started a new thread or
                  be replying elsewhere.


                  David Stiller
                  Adobe Community Expert
                  Dev blog, http://www.quip.net/blog/
                  "Luck is the residue of good design."


                  • 6. Re: MOVIE CLIP
                    Mary_Alice Level 1
                    I am only working on this post. I am now going to change button Actionscript for variable names similar to:

                    this._parent.form_mc.my_lv.household = household_txt.text;
                    • 7. Re: MOVIE CLIP
                      Mary_Alice Level 1
                      I think the form has no instance name...? Only a variable name: form.
                      • 8. Re: MOVIE CLIP
                        Mary_Alice Level 1
                        Whoops. No variable name for the FORM, only an instance of name: FORM.
                        And it does not seem to have an instance name. Or, is instance of the same as instance name?
                        • 9. Re: MOVIE CLIP
                          Level 7
                          Mary Alice,

                          > Whoops. No variable name for the FORM, only an instance of
                          > name: FORM. And it does not seem to have an instance name.

                          First all, I need to clarify a major typo in my last post. I totally
                          destroyed the object reference I've been trying to explain, so please accept
                          my apologies, and I hope my current reply will clarify matters.

                          Because your path contains the expression "form_mc," the instance name
                          of that movie clip -- the one that's holding all the text fields -- needs to
                          be form_mc (because that's the name in your path).

                          Think of this in terms of folders on your hard drive; it's a great
                          analogy to what's going on here. That button interprets the ActionScript
                          object reference like this: "From my own point of view (this), I'll look up
                          one 'folder' to the timeline I'm in (_parent). From there, I'll look look
                          for an object with the instance name form_mc. That movie clip contains a
                          number of nested objects, one of whose instance names is household_txt.
                          That nested object is a text field, which means it has a text property.
                          That's what I want." So, string those all together and you get:

                          this._parent.form_mc.household_txt.text;

                          That's the location of one of the text fields from the point of view of
                          the ActionScript associated with your button. In my last reply -- I'll
                          blame it on a lack of coffee today (lame excuse!) -- I put that object
                          reference (that "folder path," if you will) in the wrong place.

                          Consider what you're after, though, it it should make sense. Since the
                          ActionScript is associated with the button, everything must be taken from
                          the button's point of view. The LoadVars instance is created inside the
                          button, so from the button's point of view, the LoadVars instance (my_lv) is
                          right there.

                          e.g.
                          on (release) {
                          my_lv = new LoadVars();
                          re_lv = new LoadVars();

                          So far, so good. If you want to refer to my_lv or re_lv again while
                          inside this on() handler, no object path is necessary. If you wanted to,
                          you could use this.my_lv or this.re_lv, but even without the "this," the
                          path to these objects is understood: they're right here. So, as you create
                          new properties for the my_lv object, you name the object and its new
                          property ...

                          my_lv.household =

                          ... and set that new property equal to the value of the TextField.text
                          property of one of your text fields in the path we just covered; namely,
                          this._parent.form_mc.household_txt.text. So ...

                          my_lv.household = this._parent.form_mc.household_txt.text;

                          ... and so on, with the rest of them:

                          my_lv.water = this._parent.form_mc.water_txt.text;
                          my_lv.soft = this._parent.form_mc.soft_txt.text;
                          // etc.

                          Does that clear it up?

                          Note: even after you update all of this, you may still run into
                          problems, so keep your chin up. There's a lot going on here, and you'll
                          need to work through each concept until you get it. The concept we're
                          working toward right now is object references.

                          > Or, is instance of the same as instance name?

                          The term instance refers to an object made from a template. If you use
                          the drawing tools to create some artwork and convert that artwork into a
                          movie clip, a new movie clip symbol will appear in your Library panel. You
                          can drag as many copies of that movie clip symbol to the Stage as you like.
                          Doing so means you're creating that many "instances of" the MovieClip class;
                          in particular, "instances of" a very specific movie clip in your Library.
                          Every dynamic or input text field you create, even if it isn't symbol, is
                          automatically an "instance of" the TextField class. Even if you don't give
                          them instance names, they're still instances of the classes (the type of
                          object) they represent. But without instance names, it's much hard to get
                          ActionScript to speak directly to any of them.


                          David Stiller
                          Adobe Community Expert
                          Dev blog, http://www.quip.net/blog/
                          "Luck is the residue of good design."