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
Developer
Posts: 235
Registered: ‎12-13-2011
My Device: Curve 9380
My Carrier: Vodafone-IN

ScrollPane Does not work

Hai.

       I am trying to add a container in a scroll pane.. Conatiner have one image and text field.. But i cannot scroll the scroll pane. Please help me

 

Thanks 

Deepu

Highlighted
Developer
Posts: 1,008
Registered: ‎12-12-2010
My Device: Passport (Red Limited Edition)
My Carrier: Mobile Vikings

Re: ScrollPane Does not work

What have you tried? Can you post some code?

 

Anyway, a little example how the qnx ScrollPane should be used:

 

package
{
    import flash.display.Sprite;
    
    import qnx.ui.data.DataProvider;
    import qnx.ui.events.ScrollEvent;
    import qnx.ui.listClasses.ScrollPane;
    import qnx.ui.listClasses.ScrollDirection;
    import qnx.ui.text.Label;
    
    [SWF(height="600", width="1024", frameRate="30", backgroundColor="#FFFFFF")]
    public class listSample extends Sprite
    {
        
        private var myScrollPane:ScrollPane;
        private var myLabel:Label;
        
        [Embed(source="../assets/pup.jpg")] 
        public static var bigImage:Class;
        
        public function listSample()
        {
            initializeUI();
        }
        
        private function initializeUI():void
        {
            
            myScrollPane = new ScrollPane();            
            myScrollPane.setPosition(50, 50);            
            myScrollPane.width = 300;            
            myScrollPane.height = 300;
            myScrollPane.scrollDirection = ScrollDirection.BOTH;        
            myScrollPane.setScrollContent( bigImage );
            
            myScrollPane.addEventListener(ScrollEvent.SCROLL_END, onScroll);
            myScrollPane.addEventListener(ScrollEvent.SCROLL_BEGIN, onScrollStart);
            
            this.addChild(myScrollPane);
            
        }
    
        private function onScroll(event:ScrollEvent):void {
            
            trace("Finished scrolling...");            
        }
        
        private function onScrollStart(event:ScrollEvent):void {
            
            trace("Start scrolling...");            
        }        
            
    }
}

 

 

-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!