Paul,

I've been working on using an scroll bar. The only issue I have with 
this is that it reaches the bottom of the scroll area when the scroll 
bar is about half way down. See the following example:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute" creationComplete="init();">

<mx:Script>
<![CDATA[

import mx.events.ScrollEvent;

private function init():void {
myCanvas.verticalScrollPosition =
vBar.maxScrollPosition;
myCanvas.verticalScrollPosition =
vBar.minScrollPosition;
}

private function myScroll(event:ScrollEvent):void {
myCanvas.verticalScrollPosition =
event.currentTarget.scrollPosition;
}
]]>
</mx:Script>
<mx:Canvas width="100%" height="100%">
<mx:Canvas id="myCanvas" left="0" top="0" right="15"
bottom="0" verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:Button label="Button 1" left="10" top="0"/>
<mx:Button label="Button 2" left="10" top="250"/>
<mx:Button label="Button 3" left="10" top="1250"/>
<mx:Button y="2500" label="Button 4" left="10"
includeInLayout="false"/>
</mx:Canvas>
<mx:VScrollBar id="vBar" minScrollPosition="250"
maxScrollPosition="1250" lineScrollSize="35" pageScrollSize="50"
repeatDelay="1000" repeatInterval="500" scrollPosition="250"
scroll="myScroll(event);" right="0" top="0" bottom="0"/>
</mx:Canvas>
</mx:Application>


JF
--- In [email protected], "Paul Andrews" <p...@...> wrote:
>
> ----- Original Message ----- 
> From: "jmfillman" <jmfill...@...>
> To: <[email protected]>
> Sent: Tuesday, December 23, 2008 11:22 PM
> Subject: [flexcoders] Re: Display only part of a canvas??
> 
> 
> > Hi Tracy,
> >
> > This may work, I'd have to try it, and may be my best option. I 
was
> > hoping to be able to reset the scrollBar so that it appears to the
> > user that they are seeing everything.
> 
> Why can't you just suppress the scrollbar and add one of your own? 
You can 
> set it to whatever you like then.
> 
> Paul
> 
> >
> > JF
> > --- In [email protected], "Tracy Spratt" <tspratt@> 
wrote:
> >>
> >> Just thinking aloud, but supposed you intercepted the scroll 
events
> > and
> >> calculated whether the user was allowed to move that way and 
apply
> >> preventDefault if not?
> >>
> >> Tracy
> >>
> >>
> >>
> >> ________________________________
> >>
> >> From: [email protected]
> > [mailto:[email protected]] On
> >> Behalf Of jmfillman
> >> Sent: Tuesday, December 23, 2008 4:07 PM
> >> To: [email protected]
> >> Subject: [flexcoders] Re: Display only part of a canvas??
> >>
> >>
> >>
> >> I appreciate the responses, but I do not believe this will
> > accomplish
> >> what I need. Masking is the closest so far, but the scroll bars
> >> create a problem.
> >>
> >> Simply making items hidden, does hide viewable items, but leaves
> > the
> >> container with a lot of blank space.
> >>
> >> Essentially, I want to override the index or whatever values the
> >> scrollbar uses to determine the top and bottom of the container,
> > and
> >> set my own values.
> >>
> >> --- In [email protected] <mailto:flexcoders%
> > 40yahoogroups.com>
> >> , "Manish Jethani"
> >> <manish.jethani@> wrote:
> >> >
> >> > On Tue, Dec 23, 2008 at 5:41 AM, jmfillman <jmfillman@> wrote:
> >> >
> >> > > I have a Canvas that with a height of 3000. For some users, I
> >> only want
> >> > > them to be able to view and scroll a portion of the height of
> > the
> >> > > canvas, say 1200-2200. It can vary from user to user, and 
some
> >> will
> >> > > need to see the entire height. I'm at a loss as to whether or
> > not
> >> this
> >> > > is even possible, and if so, how.
> >> >
> >> > Suppose you have a canvas with 5 items.
> >> >
> >> > <Canvas>
> >> > <Item />
> >> > <Item />
> >> > <Item />
> >> > <Item />
> >> > <Item />
> >> > </Canvas>
> >> >
> >> > You want some users to see only the first 3, is that correct? 
If
> >> yes,
> >> > you can just set 'visible' to false and 'includeInLayout' to
> > false
> >> on
> >> > the items that you want to hide, and that should take care of 
it.
> >> >
> >> > -- 
> >> > manishjethani.com
> >> >
> >>
> >
> >
> >
> > ------------------------------------
> >
> > --
> > Flexcoders Mailing List
> > FAQ: 
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Alternative FAQ location: 
> > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-
446f-b4cf-1e62079f6847
> > Search Archives: 
> > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups 
> > Links
> >
> >
> >
>


Reply via email to