Skip to main content
April 5, 2015
Question

StageWebView Touch Scroll

  • April 5, 2015
  • 1 reply
  • 630 views

Hey all,

Is it possible to ditch the standard scroller on the right hand side of StageWebView and have a touch scroll instead?

I'm developing an App for a Windows 8 tablet and having the scroll bars seems a little strange when the rest of the OS and App has nice touch scrolls..

Thanks

This topic has been closed for replies.

1 reply

April 6, 2015

If this is Windows 8 only, you might as well use the HTMLLoader because that is basically what StageWebView does on desktop computers per the ASDOCs:

"On desktop computers (in the desktop and extended desktop profiles), the StageWebView class uses the system web control provided by the Flash Player plugin. The features available and rendering appearance are the same as those of the HTMLLoader class (without the close integration and script bridging between ActionScript and JavaScript provided by an HTMLLoader instance).".

If you take a look at this method of the HTMLLoader object, you can create a new NativeWindow within your AIR app that contains an HTMLLoader object. The 3rd parameter is a boolean on whether to show or hide the scroll bars. From what I can tell, there isnt any other way with the provided API. If you don't want to go through the hassle of creating a new NativeWindow in your app, you could possibly have the HTMLLoader's width set to be the size of the flash.display.Screen.mainScreen.bounds.width + X, where X is a known width of the Windows 8 scroll bar within the HTMLLoader and that would, in theory, push the scroll bar off the side of the screen so you can't see it. You might also be able to to try to use flash.html.HTMLLoader.window property to access "The global JavaScript object for the content loaded into the HTML control". With that object, you could use JavaScript code to try and hide the scrollbars as well. So there are a few options available to you. Im not sure how well the last one will work but seems like it could be worth trying. If the app can be on Windows 8 computers that don't have touch capability, you may want to check to see if flash.ui.Multitouch.supportsTouchEvents returns true or false to determine if you want to hide the scrollbars or not.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/html/HTMLLoader.html#createRootWindow()