Question

I need a desktop Adobe Air app to scroll both vertically and horizontally a stagewebview (in order to center the content) after load is completed, hide the scroll vars of the stagewebview and prevent any scroll after the initial repositioning without affecting the interaction inside the external document (internal scroll bars in a div). Right now I've been able of load the external URL but I searched about the rest without luck. Any help or advice and/or documentation? Thank you in advance guys and have a nice week.

Était-ce utile?

La solution

the following code center the scroll and hide scroll bars:

                var scrollBarWidth:int = 15;
                var maxHScroll:int = html.htmlLoader.contentWidth-html.width+scrollBarWidth;
                var maxVScroll:int = html.htmlLoader.contentHeight-html.height+scrollBarWidth;

                html.horizontalScrollPosition = (maxHScroll /2);
                html.verticalScrollPosition = ( maxVScroll /2);

                html.verticalScrollPolicy = "off";
                html.horizontalScrollPolicy = "off";

see this link for more info on how to handle HTML dom events in air.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top