I think this will help you in your quest. It may not be perfect, but it's what I've been using.
http://www.tricedesigns.com/tricedesigns_home/blog/2007/03/free-imagezoomer-flex-component.html I've had the same problems as you of dealing with the width and height = 0. I really have no idea why, but I have noticed that it does correct itself - like it's delaying setting the values or something. If you run across a solution please let me know. All I want is an image component that I can set zoom level, set position, ask to re-center, ask to best-fit. :) Enjoy! -Pat Buchanan -DataNotion On 5/8/07, vitcheff <[EMAIL PROTECTED]> wrote:
Thanks for your replay. Had a look on it, maybe will take another one, but as I was trying to do the same with a Loader component, issues were the same. Event.INIT event is fired by the Loader and it's width and height remain 0, and I have to use loader.content too. That's just something I don't get. Why do width and height remain 0 after an INIT event? --- In [email protected] <flexcoders%40yahoogroups.com>, "Adam Royle" <[EMAIL PROTECTED]> wrote: > > Not sure if this will help, but have you looked at Ely Greenfield's SuperImage Component? > > http://www.quietlyscheming.com/blog/2007/01/23/some-thoughts-on-doubt-on-flex-as-the-best-option-orhow-i-made-my-flex-images-stop-dancing/ > > Adam > > ----- Original Message ----- > From: vitcheff > To: [email protected] <flexcoders%40yahoogroups.com> > Sent: Tuesday, May 08, 2007 8:39 PM > Subject: [flexcoders] Image Component Nightmare > > > Hi all, > What I'm trying is to achieve is to have a thumbnails bar with some > images in it, which, when clicked, should display the corresponding > large version in a Canvas. > > I'm doing this through AS3 in UIComponent-based class. There is an > Image component instance which is placed in a Canvas instance. What > I'm trying to do is scale the image down to the canvas's size and then > provide a slider to zoom it in/out. > > What makes me crazy is that I have to scale image.content instead of > the image itself and after that make a ton of magic when trying to > figure what the width and height of the image is, to be able to center it. > > Although the content is scaled down, image.width remains unchanged, > and working with the content's size still brings some unexpected > behaviour in. > > Is there something bad about my approach. Handling a simple image > shouldn't be that freaking hard. Do I miss something? > > Thanks in advance! >

