5 Replies Latest reply on Oct 26, 2009 8:43 AM by pyroasta

    Frame Detection Actionscript 2.0 Flash CS3?

    pyroasta

      I'm wondering if there is a way for when multiple movie clips show certain frames, something could appear?

       

      For example, I am making a Dress Up Game, but I want other characters in it. The only problem is I want them to be unlockable with certain items of clothing shown at one time. Is this at all possible? If there is a script please post it, or a link I can find it on.

        • 1. Re: Frame Detection Actionscript 2.0 Flash CS3?
          Ned Murphy Adobe Community Professional & MVP

          I doubt you will find a script.  This will be someything you will need to create yourself.  What you will want to do is have some function that tests what the _currentframe value is for whatever movieclips you are talking about and compares them to see if they match a pattern.  Certain patterns will produce certain results.  This will all have to be specially coded by you.

           

          What you might do is store sets of values as arrays within an array, and then each time you complete shuffling your movieclips you have a function that first collects the _currentframe values in some order into an array, then compares that array to your sets one at a time, and if a match is found, you have some actions predefined for that matching.

          1 person found this helpful
          • 2. Re: Frame Detection Actionscript 2.0 Flash CS3?
            pyroasta Level 1

            ok, so what would be the base of it? would it be something like;

             

            if (_root.instancename._currentframe == 3) {
               (_root.instancename._currentframe == 4) {
            }

             

            And whatare arrays exactly? or are those the "{}" marks?

            • 3. Re: Frame Detection Actionscript 2.0 Flash CS3?
              Ned Murphy Adobe Community Professional & MVP

              Something more like...

               

              if (_root.instancename1._currentframe == 3 && _root.instancename2._currentframe == 4) {
                        // do something

              }

              Arrays are a set of things/data represented by a single variable name that are isolatable by index numbers.  If you don't know what arrays are, you are going to have to take some time to learn some basic programming. These forums aren't for teaching people how to program or to design things for them.

              1 person found this helpful
              • 4. Re: Frame Detection Actionscript 2.0 Flash CS3?
                ckpepper02 Level 1

                I'd add to that to remember that the _currentframe property only accepts numeric values. If you try to map a frame label to it (i.e. "shirt1"), it wont work. Found that out the hard way a while back

                • 5. Re: Frame Detection Actionscript 2.0 Flash CS3?
                  pyroasta Level 1

                  Ok, I have most of the code down, I'm just confused on the right parameter name to put down.

                   

                  here's what I got:

                   

                  cover2._visible = false;
                      cover2.porymovie.onEnterFrame = function(if (_root.head._currentframe == 2 && _root.beak._currentframe == 2 && _root.body._currentframe == 2 && _root.chest._currentframe == 2 &&_root.rightlimb._currentframe == 2 && _root.leftlimb._currentframe == 2 && _root.tail._currentframe == 2) {
                                                                                                                                                                                                                                                                                                                   }
                      cover2._visible = false;
                  };
                      porymovie.onEnterFrame = function(if (_root.head._currentframe == 2 && _root.beak._currentframe == 2 && _root.body._currentframe == 2 && _root.chest._currentframe == 2 &&_root.rightlimb._currentframe == 2 && _root.leftlimb._currentframe == 2 && _root.tail._currentframe == 2) {
                      var sndMusic = new Sound();
                  sndMusic.attachSound("233");
                  sndMusic.start();
                  }

                   

                  I almost have it nailed, but I just can't find the right parameter name.