2 Replies Latest reply on Sep 21, 2006 1:00 PM by Newsgroup_User

    align external images

    Level 7
      hi

      how can i do to align a external image?
      every time i load a external image inside a movieclip
      (mc.loadMovie("imglocation"))...
      the image always start at 0,0 of the movieclip
      there are no options to "align" this image to the movieclip center? like
      ctrl+k? align x,y position?

      Gustavo


        • 1. Re: align external images
          scsherwood Level 1
          I'm not sure I understand what you're doing, but I assume you're loading the image inside of a container (i.e. a movieclip) that then can be positioned on the stage. Usingthe stage.width and stage.height properties you can determine where the center of the stage is or if this mc is inside of another mc use the _width and _height properties of the parent movie clip to determine where the center of that mc is. Then set the _x and _y properties of the container mc to position/align your image.
          • 2. Re: align external images
            Level 7
            yes...
            here is what im doing:

            ''''interval''''{
            total = mc_imagem2.getBytesTotal();
            loaded = mc_imagem2.getBytesLoaded();
            pct = (loaded/total)*100;

            if(pct==100){
            posLeft = _root.mcReference._x+ (_root.mcReference._width/2 -
            _root.mc_imagem2._width/2);
            posTop = _root.mcReference._y+(_root.mcReference._height/2 -
            _root.mc_imagem2._width/2);
            '''clearInterval''''
            }


            works fine... but. i have problems... few problems... i cant prevent the
            "100%" loaded function....
            i want to this actions only if the image is already loaded.... and.... the
            swf works fine inside InternetExplorer... but inside firefox and opera...
            pfsss.... doesnt work....
            in firefox or opera.... the action is being executed without 100% loaded
            why?
            there is another way to do that?


            "SherwoodClark" <webforumsuser@macromedia.com> escreveu na mensagem
            news:eeuqf2$su$1@forums.macromedia.com...
            > I'm not sure I understand what you're doing, but I assume you're loading
            > the
            > image inside of a container (i.e. a movieclip) that then can be positioned
            > on
            > the stage. Usingthe stage.width and stage.height properties you can
            > determine
            > where the center of the stage is or if this mc is inside of another mc use
            > the
            > _width and _height properties of the parent movie clip to determine where
            > the
            > center of that mc is. Then set the _x and _y properties of the container
            > mc to
            > position/align your image.
            >