Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
Badge
Posts: 16
Registered: ‎01-04-2011
My Device: Not Specified
My Carrier: Java Developer

ScrollPane-Object out of the screen

hi everyone,

I have a doubt in how ScrollPane works.

The objects(containers) situaded out of the screen in the scroll pane(not visible yet),are yet drawn o they will be drawned when will be visible(after a scrolling)?

I want to load an image in a container when the container itself is on the screen.my first idea was to override the method draw,but i think that the container outside the screen mbut yet setting inside the scrollpane,are yet drawned,i would like to add image only when,during a scrolling,they will be visible on screen.i tried also with onAdded,but on Added is activated when you add the item inside another,and so at the beginning.

I hope i have explain the problem well,but i doubt it :smileyhappy:

Please use plain text.
Developer
Harry_Dodgson
Posts: 151
Registered: ‎10-26-2010
My Device: Bold 9900
My Carrier: AT&T

Re: ScrollPane-Object out of the screen

Hi,

 

    I just added a scrollpane to my app so I have a tiny idea how things work.  When using one, you setup an area on the screen where you want it.  Then you take your (possibly) oversized object and put it in it (so to speak).  What fits will be shown.  What doesn't fit can be scrolled into view.  There are horizontal and vertical scrollbars (sort-of) that show up while scrolling the object.  The nice thing about the scrollpane is you don't have to "sweat the small things".  Just pretend you have an infinite canvas to draw into and let it handle what actually displays.

 

Harry

--------------
Accepted PlayBook Applications: Marmi-doos, BASIC, Run and Hide
Please use plain text.
Contributor
Badge
Posts: 16
Registered: ‎01-04-2011
My Device: Not Specified
My Carrier: Java Developer

Re: ScrollPane-Object out of the screen

thanks for the response.
i know it,what i would like to know is if the object outside the real dimension of the screen(stage),are yet draw or they will be drawned when they are inside the stage.If they are already drawned,is there a method that intercept when the object reach visibility on screen?My first try was after a scrollEnd,it works,but i need it during the scrolling.

Please use plain text.
Developer
Harry_Dodgson
Posts: 151
Registered: ‎10-26-2010
My Device: Bold 9900
My Carrier: AT&T

Re: ScrollPane-Object out of the screen

Hi,

 

    Any good rendering engine will not attempt to draw anything that won't be seen.  So if you have an object that is completely outside the scollpane, it should skip it and go onto the next one.

 

    I don't know if there are any events for when an object is rendered or not.  If I had to do it. I'd track the location of my object inside the scrollpane to see when it was inside of it.  I think you can get the current scroll position from the scrollX and scrollY properties.

 

Harry

--------------
Accepted PlayBook Applications: Marmi-doos, BASIC, Run and Hide
Please use plain text.