1 Reply Latest reply on Oct 16, 2006 3:01 PM by DazFaz

    loading SWF's: centering

    southbeachbum Level 1
      I've got a script which applies to a clip, myClip. I need to load movies or image files into that clip. What loads needs to be at a higher level than everything else, let's say level 100. The loading swf's contain a single image whose registration point is center. The target clip, myClip, is centered on the stage. But when the swf loads, it loads on the upper left of itself on the position of myClip.

      How do I center the loaded swf?
        • 1. Re: loading SWF's: centering
          DazFaz Level 1
          The easiest way is to change the "0" registration point in the movieClip that you are loading everything into.

          To do this, get inside the mov loader by double clicking it. Then once inside, select all and then press "Ctrl + i" to bring up your info pallet. Select all "Ctrl + a" and you will notice that there are now dimensions in the info pallet. The figures you are intersted in are on the right (X:Y:). Also you will notice a grid like graphic in between the 2 sets of numbers. There are 2 reference points on this grid that you can click on. One is to the top left and one is in hte centre. Make sure you have click on the centre one. (This should appear like a small square black dot) And the top left should now be a white box.

          Once you have done this the figures in the X:Y: should have changed to more than 0 in each.

          You need to change both of these to 0

          So now
          X:0
          Y:0

          as you do this you will see your movieClip change postion. This is supposed to happen as you are changing the ref point for this clip.

          Great

          Now come out of the Mov Clip and repostion it again from the main time line.

          Now, i you have done it correctly, Eveything that was loading to the top left will now load centre.

          This is the manual way of doing in but the other way is by using actionscipt with a movie handler.

          MovieClipLoader.loadClip()