3 Replies Latest reply on Jan 15, 2007 12:37 AM by Shandy Elliott

    2 mc's no display

    jagguy99
      I want to display 2 movie clips created dynamically in a function. This only displays 1 and I don't know where I have gone wrong. I need a little help.

      var mLoad:MovieClipLoader = new MovieClipLoader();
      var mLoad2:MovieClipLoader = new MovieClipLoader();

      var i=0;

      mc3.onPress = function () {
      i+=1;

      //_root.createEmptyMovieClip("mc2",this.getNextHighe stdepth());
      this._parent.createEmptyMovieClip("mcc"+i,this.get NextHighestdepth());
      this._parent["mcc"+i]._x=100;
      this._parent["mcc"+i]._y=10;
      mLoad.loadClip("93img2.jpg","mcc"+i);
      i+=1;

      this._parent.createEmptyMovieClip("mcc"+i,this.get NextHighestdepth());
      this._parent["mcc"+i]._x=300;
      this._parent["mcc"+i]._y=10;
      mLoad2.loadClip("93img2.jpg","mcc"+i);
      trace(i);
      // holder["p"+ipic]._alpha = 0;

      }
        • 1. 2 mc's no display
          Shandy Elliott Level 1
          Well, for one,

          this._parent.createEmptyMovieClip("mcc"+i,this.get NextHighestdepth());

          isn't correct syntax - should be

          this._parent.createEmptyMovieClip ("mcc" + i, this.getNextHighestDepth ());

          Without looking deep into your other code, this may fix it or not, but I'm sure it's a big reason.
          • 2. Re: 2 mc's no display
            jagguy99 Level 1
            yes it fixed it thankyou and I added this_parent.next.....

            I am a little confused about making dynamic objects like movie clip using this_parent.createEmptyMovieClip or this.createEmptyMovieClip or just createEmptyMovieClip. I want the clip to be accessed anywhere in the main timeline.
            • 3. Re: 2 mc's no display
              Shandy Elliott Level 1
              quote:

              I want the clip to be accessed anywhere in the main timeline.


              use _root.createEmptyMovieClip then

              You can also simply use this.createEmptyMovieClip (unless you have the code withing a function or a button - because then you would be scoping the function or button, respectively). When you are writing action script, it's always a good idea to check your syntax. I can't imagine you NOT getting an error in the output panel when you published your incorrect syntax.

              In your action script panel, there is a series of 7 icons above the area where you would be typing your script. Icons 4 and 5 will help you with syntax and scripting alignment.

              If you notice when you are scripting in your action scripts panel, certain words should have different colors to them (according to how you have those settings), you can highlight the code "this" and then hit F1 for more info on it. This works with all script (well most).