Ahh... I was thinking just override the getter for measuredHeight...
but you can't override a getter anyway, can you.

I'll give it a try and see how it works.
Thanks again, Alex!

--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Yeah, subclass, override measure(), and report a better measuredHeight.
> The framework should be factoring in scale factor so this may not work,
> but at least you'll know if getting that number right is going to solve
> your problem.
> 
>  
> 
> ________________________________
> 
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of carl_steinhilber
> Sent: Wednesday, September 12, 2007 1:33 PM
> To: [email protected]
> Subject: [flexcoders] Re: Issues scrolling a scaled image. Can it be
> fixed?
> 
>  
> 
> Thanks Alex.
> It *does* report a measuredHeight. And it is, indeed, the true height
> (with no scaling)... so it does seem like it's incorrect.
> 
> So what would be the best way to subclass it? Just override and set to
> the current value of height (or contentHeight, which also appears to
> be correct)? Or is there something more to it?
> 
> Thanks again,
> -Carl
> 
> --- In [email protected] <mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui" <aharui@> wrote:
> >
> > I'd check to see what the Image is reporting as measuredHeight. It
> > might be wrong and you can subclass and fix it.
> > 
> > 
> > 
> > ________________________________
> > 
> > From: [email protected] <mailto:flexcoders%40yahoogroups.com>
> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of carl_steinhilber
> > Sent: Wednesday, September 12, 2007 11:31 AM
> > To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] Re: Issues scrolling a scaled image. Can it be
> > fixed?
> > 
> > 
> > 
> > Okay... from the lack of response, I can only assume that it was too
> > difficult to set up a testbed. ;-) So perhaps providing sample
> > images will make things easier:
> > 
> > http://www.thinkhmh.com/_img/flex/red-block-300x100.jpg
> <http://www.thinkhmh.com/_img/flex/red-block-300x100.jpg> 
> > <http://www.thinkhmh.com/_img/flex/red-block-300x100.jpg
> <http://www.thinkhmh.com/_img/flex/red-block-300x100.jpg> > 
> > http://www.thinkhmh.com/_img/flex/blue-block-300x200.jpg
> <http://www.thinkhmh.com/_img/flex/blue-block-300x200.jpg> 
> > <http://www.thinkhmh.com/_img/flex/blue-block-300x200.jpg
> <http://www.thinkhmh.com/_img/flex/blue-block-300x200.jpg> > 
> > http://www.thinkhmh.com/_img/flex/green-block-500x600.jpg
> <http://www.thinkhmh.com/_img/flex/green-block-500x600.jpg> 
> > <http://www.thinkhmh.com/_img/flex/green-block-500x600.jpg
> <http://www.thinkhmh.com/_img/flex/green-block-500x600.jpg> > 
> > 
> > I've tried everything from setting the height of the image to the
> > contentHeight, to trying to explicitly invalidate the size... and I'm
> > about to keel over dead from hitting my head on the desk so many
> times.
> > 
> > Does nobody really have any insight?
> > Thanks again,
> > -Carl
> > 
> > --- In [email protected]
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > , "carl_steinhilber"
> > <carl_steinhilber@> wrote:
> > >
> > > I have a fairly simple Flex 2 app that uses a canvas container to
> > > scroll the display of a child image element.
> > > 
> > > Consider the following mxml, with three images: 300x100px,
> 300x200px,
> > > and 500x600px. 
> > > The canvas has:
> > > - both scroll policies set to auto (thought eventually, horz will be
> > > set to off
> > > - fixed with of 316px (300 + the width of the vertical scrollbar)
> > > 
> > > The child image has:
> > > - fixed width of 300px
> > > - maintainAspectRatio set to true
> > > 
> > > Loading the 300x100px image into the image component results in no
> > > scrollbars, as expected.
> > > 
> > > Loading the 300x200px image into the image component results in a
> > > vertical scrollbar only, as expected, and when the scrollbar is at
> the
> > > bottommost position in the track we see the bottommost edge of the
> > > image, also as expected.
> > > 
> > > Loading the 500x600px image into the image component results in a
> > > vertical scrollbar only, again as expected (since the width of the
> > > image component is set to 300 and scaling occurs), but now as we
> > > scroll down it goes well beyond the bottom edge of the image, NOT as
> > > expected.
> > > 
> > > I need the scrollbar in this case to allow to user to scroll down
> only
> > > as far as the bottom edge of the image (just like with the 300x200px
> > > image).
> > > 
> > > Is there something I can do to enforce this rule?
> > > 
> > > 
> > > <?xml version="1.0" encoding="utf-8"?>
> > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
> <http://www.adobe.com/2006/mxml> 
> > <http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml> > "
> > > layout="absolute">
> > > <mx:Script>
> > > <![CDATA[
> > > private function changePicture(pictNum:int):void{
> > > switch (pictNum){
> > > case 1:
> > > imageCroppedImage.source="red-block-300x100.jpg";
> > > break;
> > > case 2:
> > > imageCroppedImage.source="blue-block-300x200.jpg";
> > > break;
> > > case 3:
> > > imageCroppedImage.source="green-block-500x600.jpg";
> > > break;
> > > }
> > > }
> > > ]]>
> > > </mx:Script>
> > > 
> > > <mx:Canvas id="canvasViewPort" width="316" height="100"
> > > verticalScrollPolicy="auto" horizontalScrollPolicy="auto" x="20"
> > y="20">
> > > <mx:Image id="imageCroppedImage" width="300"
> > > maintainAspectRatio="true" /> 
> > > </mx:Canvas>
> > > 
> > > <mx:Button label="Picture 1 (300x100)" click="changePicture(1)"
> > > x="20" y="150" />
> > > <mx:Button label="Picture 2 (300x200)" click="changePicture(2)"
> > > x="20" y="185" />
> > > <mx:Button label="Picture 3 (500x600)" click="changePicture(3)"
> > > x="20" y="220" />
> > > </mx:Application>
> > > 
> > > 
> > > Thanks in advance!
> > > -Carl
> > >
> >
>


Reply via email to