3 Replies Latest reply on May 10, 2006 3:04 AM by Newsgroup_User

    zooming a loaded bitmap around the image center

    Level 7
      Hi,

      I try to zoom a loaded PNG where the center of the image stays at the
      middle of the stage.

      I don't know everyting I do leads me to a clip moving away from the
      center of the stage.

      What I do is zooming a clip that contains the clip that is loaded. I set
      the loaded Clip at the negative half of its size, so it should aprear in
      the middle.


      onClipEvent(load){

      pic_container_mc.loadMovie("pic.png");

      //picLoaded() < it is called from the clip
      // pic_container_mc at onLoad event
      // when the bytestotal are > 1000
      function picLoaded(){
      pic_container_mc._alpha = 0;
      pic_container_mc.onEnterFrame= function(){
      this._alpha = this._alpha * 1,2;
      this._alpha++;
      _parent._xscale++;
      _parent._yscale = _parent._xscale;
      }

      w = pic_container_mc._width;
      h = pic_container_mc._height;

      pic_container_mc._x = - w/2;
      pic_container_mc._y = - h/2;

      // half of the strange size
      this._x = 512;
      this._y = 384;
      }

      }

      Any ideas?