1 Reply Latest reply on Jun 20, 2008 4:30 AM by thewarpedcoder

    Resize Effext on Image

    thewarpedcoder
      Hi

      I have a container with images in built up within a private function. I then want to use the resize effect on the image when it is moused over.

      I have this working in MXML but am a little lost on how to resolve it in Action Script.

      Ill post code below if anybody could help.

      Thanks.

      private function showFilmChoice():void
      {
      subSelection.removeAllChildren();

      var i:int;

      for (i = 0; i < subImagesArray.length; i++)
      {
      var tmpImg:Image = new Image();
      tmpImg.id = subImagesArray ;
      tmpImg.width = 40;
      tmpImg.height = 50;
      tmpImg.source = "assets/images/films/" + subImagesArray
      + ".jpg";
      tmpImg.addEventListener(MouseEvent.MOUSE_OVER,imageSizeUp);
      tmpImg.addEventListener(MouseEvent.ROLL_OUT, imgSizeDown);

      subSelection.addChild(tmpImg);
      }

      }
      private function imgSizeUp(event:MouseEvent):void
      {
      event.currentTarget.width = 100;
      event.currentTarget.height = 125;
      }
      private function imgSizeDown(event:MouseEvent):void
      {
      event.currentTarget.width = 40;
      event.currentTarget.height = 50;
      }