3 Replies Latest reply on Nov 4, 2007 1:09 PM by Newsgroup_User

    centering images

    Level 7
      I have an 240 x 240 image control that is bound to data received from
      flickr. I load different images into the control and the control respects
      the aspect ratio and displays the image correctly within the 240x240 area of
      the control. But it always displays from the upper left corner. I would
      like it to center the image horizontally and vertially after it loads each
      image, but I can't find a way to do that. The image.width is always 240
      even when it's a narrow image. image.contentWidth always returns NaN. I
      tried putting it into a vbox but it just centers the image control, not the
      contents of the image control.

      I there a way to center it using the image control and binding, or do I need
      to just do everything manually with actionscript they way I would have done
      it with Actionscript 2 loading into a movieClip and repositioning on the
      init() callback?

      thanks