4 Replies Latest reply on Mar 4, 2009 8:34 AM by Newsgroup_User

    if Current Frame Lable == ???

    W_Bell Level 1
      currently I have been using this frame number with conditional logic to do some stuff but I know it will and already has come back to haunt me when I made some changes to the timeline. So in order to avoid this is there a way to use if (this._currentlable == FrameLableName) {
      //do something
      }


      similar to:

      if (this._currentframe == 41) {
      do something();
      }
        • 1. if Current Frame Lable == ???
          W_Bell Level 1
          I think this may be it but if someone could confirm the syntax is correct that would be geat.
          I notice it uses "NO"_ in the syntax and also a string instead of frame number.

          This does not work the same as the currentframe syntax so something is not correct here.
          Maybe I need to omit the "this" from the condition.
          Anybody use his method to call or identify a frameLable?

          if (this.currentFrameLabel == "CI") {
          //do something
          }
          • 2. Re: if Current Frame Lable == ???
            Ned Murphy Adobe Community Professional & MVP
            Unless there is some new old property I never knew about, that is most likely a home-made variable that gets assigned a value via actionscript when timeline travel reaches a frame with a label.
            • 3. Re: if Current Frame Lable == ???
              robdillon Most Valuable Participant
              AS2 doesn't have a property for the frame label. AS3 does. It's currentLabel. There is also a currentLabels property.
              • 4. Re: if Current Frame Lable == ???
                Level 7
                W_Bell,

                >> I think this may be it
                >>
                >> currentFrameLabel

                Conceptually, this exists for ActionScript 3.0 (the actual MovieClip
                property is called currentLabel in AS3), but NedWebs nailed it when he
                suggested a custom variable:

                > Unless there is some new old property I never knew about,
                > that is most likely a home-made variable that gets assigned
                > a value via actionscript when timeline travel reaches a frame
                > with a label.

                Remember, you can always find the full functionality of whatever object
                you're dealing with by looking up its class in the Help docs. Objects are
                defined by classes (think of the class as a blueprint), and the class name
                usually matches the name of the object itself. You're dealing with a movie
                clip symbol, so you'll be consulting the MovieClip class ( ... see the
                TextField class for text fields, the Sound class for sounds, and so on).
                Once you're inside the class entry, look for the Properties heading to see
                what characteristics the object has -- such as _currentframe, or
                currentFrame in AS3 -- look for Methods to see what the object can do, and
                look for Events to see what the object can react to.

                In AS2, there is no currentLabel property, to as NedWebs described, you
                can declare a variable scoped to the movie clip in question, and use frame
                scripts to update the value of that variable to represent the names of frame
                labels. That way, instead of checking for a property of that movie clip
                (such as _currentframe), you can check the value of the variable instead.


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