1 Reply Latest reply on Feb 25, 2008 11:06 AM by i_am_captivate

    Problem with the x y for attachMovie

    ooba
      emptyClip.attachMovie('navSlot', 'navSlot1', emptyClip.getNextHighestDepth() );

      Here is the issue. I have a MovieClip that I use to dynamically add other clips to on the stage (emptyClip).
      I am adding another movie clip (navSlot) to the emptyClip and calling it 'navSlot1'.
      Herein lies the issue.
      Though everything that I create I have ensured that the coordinates are always based off of the top left corner being 0,0, this I will refer to as "Base0".
      The issue is that when I attachMovie the navSlot movie clip when it is placed on the stage but its Base0 is now the center of the movie clip instead of the top left corner.

      How is this possible and what is the best way to fix this?
        • 1. Re: Problem with the x y for attachMovie
          i_am_captivate Level 1
          Hello,

          There are 2 things you need to consider.

          First off eventhough you are ensuring that the x and y values are based off the top left corner, when you actually create the movieclip, within the properties, you will see a registration point image that allows you to customize the registration point for the MC, or where 0,0 is for that movieclip.

          In your example, what I do, is break apart "emptyClip", and then convert it to a symbol again. When you go to convert it to a symbol, when you specify it is a movieclip, there should be a "registration" area with 9 dots. In your case, make sure there is a black dot on the top left. That way, when you use attachMovie, it will attach it all to the top left instead of centering it.

          Secondly, you can dynamically specify the exact x and y values using attachmovie, if you do not already know this.... for example,

          emptyClip.attachMovie('navSlot', 'navSlot1', emptyClip.getNextHighestDepth(), {_x:100, _y:100} );

          HTH,

          Doug