3 Replies Latest reply on Jan 16, 2007 11:06 AM by oscar7878

    help creating a path using variables.

    oscar7878 Level 1
      HI

      I;m trying to create a path to a movievclip created with attachMovie. I need tio create the path using variable:

      _root.var1.var2.gotoAndPlay("something");

      How can I tell flash that var1, var2, etc are variables and not a relative path?

      Tks,
        • 1. Re: help creating a path using variables.
          willie_lee Level 1
          Hello Tks,

          depending where the movieclip is that you are trying communicate with you need to use either other movieclips or you will need to use _parent.

          var gong:MovieClip;
          var bong:MovieClip;
          var song:MovieClip;

          this.attachMovie("gong".....
          gong.attachMovie("bong"....
          bong.attachMovie("song"...

          to access song from the timeline in which all these movie clips were attached

          this.gong.bong.song.variable

          from song to the timeline in which all movie clips were attached

          song._parent._parent._parent.variable

          Hope this helps..
          moozungu

          • 2. Re: help creating a path using variables.
            jonnybennett Level 1
            rootTimeline=_root;

            // You can set var1 or var2 to what you like.

            var1='mc2';
            var2='mc3';

            rootTimeline[var1][var2].gotoAndPlay("something");

            //I think that is what you wanted to do?
            • 3. Re: help creating a path using variables.
              oscar7878 Level 1
              Hi and thank you for your reply.

              I'm creating the movie clips using actionscript. The path to each movie clip is different each time. I dont need to call variable inside a movieClip i need define the path. so:

              in your example:

              this.attachMovie("gong".....
              gong.attachMovie("bong"....
              bong.attachMovie("song"...

              Then

              var var1:String =gong;
              var var2:String =bong;
              var var3:String =song;

              I need to create the path to access "song" and gotoAndPlay("something") inside "Song"

              _root.var1.var2..var3.gotoAndPlay("something");

              tks