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: 223
Registered: ‎04-26-2012
My Device: Z10
My Carrier: Vodafone

How to scrollBy or scrollPosition on qnxStageWebview

Hi!

I'm having troubles to use scrolBy or scrollPosition on a qnxstagewebview. It's supposed to move scrolling on webview but it is doing nothing.

This is a basic sample, a webview and a button to move scroll.

What am I doing wrong? How to programatically move scroll position?

 

 

 

package
{
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.filesystem.File;
	import flash.geom.Point;
	import flash.geom.Rectangle;
	
	import qnx.events.WebViewEvent;
	import qnx.fuse.ui.buttons.Button;
	import qnx.media.QNXStageWebView;
	
	public class TestWebView extends Sprite
	{
		private var wk:QNXStageWebView;
		private var b:Button=new Button();
		public function TestWebView()
		{
			super();
			
			// support autoOrients
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			
			wk=new QNXStageWebView("kaka");
			this.addEventListener(Event.ADDED_TO_STAGE, added);
			wk.addEventListener(WebViewEvent.DOCUMENT_LOADED, pagina);
		}
		private function added(e:Event):void{
			b.setPosition(20, stage.stageHeight-b.height);
			b.addEventListener(MouseEvent.CLICK, click);
			this.addChild(b);
			wk.viewPort = new Rectangle(10, 10, stage.stageWidth-20, b.y-10);
			wk.loadURL("http://elpais.com");
			wk.stage=this.stage;
		}
		private function pagina(e:WebViewEvent):void{
			trace("Loaded");
		}
		private function click(e:MouseEvent):void{
			trace("button clicked "+wk.scrollPosition.y);
			wk.scrollPosition=new Point(0, 300);
wk.scrollBy(0, 100); } } }

 

My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords
Retired
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook
My Carrier: Bell

Re: How to scrollBy or scrollPosition on qnxStageWebview

Seems to me like this is a bug. Please file a bug report and I'll escalate the issue.

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Developer
Posts: 223
Registered: ‎04-26-2012
My Device: Z10
My Carrier: Vodafone

Re: How to scrollBy or scrollPosition on qnxStageWebview

Thanks Dustin.

 

Here you got it

 

https://www.blackberry.com/jira/browse/BBTEN-1545

 

 

It works fine on Playbook!

My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords
Retired
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook
My Carrier: Bell

Re: How to scrollBy or scrollPosition on qnxStageWebview

Thanks! I've escalated the issue.

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Developer
Posts: 223
Registered: ‎04-26-2012
My Device: Z10
My Carrier: Vodafone

Re: How to scrollBy or scrollPosition on qnxStageWebview

Just to clarify, scrollBy works on playbook but scrollPosition=new Point(x,y) does not seem to work

My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords