My guess is that you have an explicit width / height set on the image.
In flex, an explicitly set width height Is essentially setting the
widthAfterScale and heightAfterScale.  So setting scaleX and scaleY
won't change the on screen rendererd size of the child. You need to
manually scale the explicit width/height, _and_ set the scaleX/scaleY of
the image.

 

Ely.

 

 

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of vitcheff
Sent: Tuesday, May 08, 2007 7:06 AM
To: [email protected]
Subject: [flexcoders] Re: Image Component Nightmare

 

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] <mailto: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] <mailto: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!
>

 

<<image001.jpg>>

<<image002.jpg>>

Reply via email to