0 Replies Latest reply on Dec 14, 2012 1:42 PM by sgfone

    How to go to top of htmlLoader page

    sgfone

      Hi - I have written an AIR app using Flash Builder 4.6 (Flex 4.6) that is called by various SWF modules.  The AIR app is

       

      called with parms that include the URL and the window size.  The app is mostly successful but I am having a difficult time

       

      trying to do what I thought was simple - go to the top of the page after it is loaded.  For example - I load a web page

       

      which in turn can load another web page when a link in the page is clicked.  I do handle that (2nd) onLoad event when that

       

      new page is loaded but I cannot get to the top of the new loaded page.  The problem occurs when I have scrolled down from

       

      the top of the first loaded page and click on a link - the new page is loaded but the verticalScrollPosition does not

       

      change - it is set where the first loaded page was scrolled to.

       

      I have tried the following:

       

      ...htmlLoader.window.document.body.clientHeight

      ...htmlLoader.window.document.body.height

       

      ...browserInsideFlex.height   

         (the above is the ID of the <mx:HTML id="browserInsideFlex" />

         which is loaded with this statement:  browserInsideFlex.location = URLin;

       

      Also used scroller.height

       

      All to no avail. 

       

      So my question is - how do I:

       

      1)  get the correct height of the loaded URL

      2)  get to the top of the previously scrolled window after a new load

       

      I have viewed all the verticalScrollPosition numbers via FB 4.6 debugger but they are all 0 - even after I scroll.

      Do I need to use ExternalInterface to allow javascript to do the work?

       

      Thanks much for any help/direction.