6 Replies Latest reply on Oct 15, 2006 8:55 PM by ggshow

    syntax replacing tellTarget?

    raouldelorez
      Documentation say tellTarget is deprecated;
      Instead of

      tellTarget ("_parent."+_parent.firstnr+".obj"+this._name) {
      play();
      }

      what is the correct syntax?, tried

      ["_parent."+_parent.firstnr+".obj"+this._name].play();

      but does not work.
      anybody knows?
        • 1. Re: syntax replacing tellTarget?
          ggshow Level 2
          let us know where you attach the code, & your "this" refer to which object?

          try the code below as well:

          _parent[_parent.firstnr+".obj"+this._name].play();
          • 2. Re: syntax replacing tellTarget?
            raouldelorez Level 1
            thank you,
            it almost worked. what does works is
            _parent["."+_parent.firstnr+".obj"+this._name].play();
            strange, but dont know why.

            maybe because 'firstnr' have numberic values in the fla as the instance names
            • 3. Re: syntax replacing tellTarget?
              raouldelorez Level 1
              OOPS!
              does not works!
              I forget to delete

              tellTarget ("_parent."+_parent.firstnr+".obj"+this._name) {
              play();
              }

              I have both in .fla, when delete telltarget... does not works anymore
              • 4. Re: syntax replacing tellTarget?
                raouldelorez Level 1
                I try simplify to fix values. 'firstnr' is a number (instance name) of one of many duplicated movieclips made from one movieclip in main timeline, I do with

                for (n=1; n<=10; n++) {
                duplicateMovieClip("somemovieclip", n, n);
                }

                then I try

                tellTarget ("_parent.5.obj4") {
                play();
                }

                which works correct, but

                _parent.5.obj4.play();

                does not works correct


                If I change to

                for (n=1; n<=10; n++) {
                duplicateMovieClip("somemovieclip", "duplicado"+n, n);
                }

                then also

                tellTarget ("_parent.duplicado5.obj4") {
                play();
                }

                works correct, BUT.....

                _parent.duplicado5.obj4.play();

                and also works correct!!!!! ????? WHY???

                why number only not??? I need number working correct with no "duplicado".... how?
                • 5. Re: syntax replacing tellTarget?
                  ggshow Level 2
                  avoid using an instance name or variable name that
                  - includes a slash
                  - includes a space
                  - includes a dot
                  - begins with a number

                  • 6. Re: syntax replacing tellTarget?
                    ggshow Level 2
                    below is some info from Flash 8 Help File:

                    Instance names must conform to the following requirements:
                    - The name must not contain any spaces.
                    - The first character must be a letter, underscore (_), or dollar sign ($).
                    Each subsequent character must be a letter, number, underscore, or dollar sign.
                    - The instance name must be unique.