HTML component scrolling (verticalScrollPosition/scrollv)

I'm trying to use an HTML component to do some of the rendering in my application and I need to be able to scroll the content to the bottom as things get added to it.  It looks like I should be able to use the verticalScrollPosition property of the HTML component (which should correctly set the scrollV property on the htmlLoader).  However, when I do this, I see the scrollbar jump to the bottom go immediately back to the top.
I'm logging the scrollV value of the htmlLoader when I do this and it looks like it's being set correctly (contentHeight - htmlLoader.height).  On successive calls to set the verticalScrollPosition property, I can see that scrollV had been set correctly.
Anyone know what might be going wrong or encountered this problem before?

So, I think I figured this one out.  I was setting the htmlText property of my HTML component when I wanted to add content.  However, doing this causes the whole thing to redraw and scroll to the top.  Unfortunately, this meant that I had to wait until getting an HTML_RENDER event before I could rescroll to the bottom and that sometimes even then it didn't work.
Instead, I now do everything using functions on the HTML DOM through ActionScript.  So, instead of saying:
      htmlText += "<p>blah<p>"
I am now using:
     var p:* = html.htmlLoader.window.document.createElement('p');
     p.innerHTML = 'blah';
     html.htmlLoader.window.document.body.appendChild(p);
This keeps the existing html content intact and allows scrolling to work much better.  It's just a little more lengthy in terms of amount of code.

Similar Messages

  • HorisontalScrollPosition Attribute of a HTML-component does not work. Why?

    Hello there,
    I would like to synchronize scroll-events of a HTML-component and a Canvas-component.
    I thought it schould be easy, and I wrote it like below....
    <mx:Script>
         <![CDATA[
              private function onCanvasScrollHandler(e:ScrollEvent):void
                   if(e.direction == "vertical")
                        myHTML.verticalScrollPosition = e.position;
                   else if(e.direction == "horizontal")
                        myHTML.horizontalScrollPosition = e.position;
         ]]>
    </mx:Script>
    <mx:HTML   id="myHTML"   width="300" height="300" horizontalScrollPolicy="on" verticalScrollPolicy="on" />
    <mx:Canvad id="myCanvas" width="300" height="300" horizontalScrollPolicy="on" verticalScrollPolicy="on" scroll="onCanvasScrollHandler(event)" />
    ....this Script does kind of work. When I scroll "myCanvas" vertially, the "myHTML" is also scrolled vertical as much.
    However this only works for vertical scrolling, but not for horizontal one. "myHTML" is not be scrolled horizontal, when the value is substituted in horizontalScrollPosition-attribute of "myHTML".
    Does anyone have a clue for this Problem?
    Thanks.
    Satoshi

    I found it my self .
    I used scrollH-property of HTMLLoader instead.
    It works until now.

  • Dragging an HTML component

    Hello,
    I'm a bit of a  newbie to Flex ( started Yesterday ) and i'm finding my way quit well. Using some of the examples that the internet provides i managed to create the following applcation:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx"
       width="1024" height="768"
       creationComplete="getData.send()" xmlns:flexui="flexunit.flexui.*">
    <fx:Script>
    <![CDATA[
    import flash.utils.flash_proxy;
    import mx.collections.ArrayCollection;
    import mx.controls.Alert;
    import mx.core.DragSource;
    import mx.effects.easing.*;
    import mx.events.DragEvent;
    import mx.events.FlexEvent;
    import mx.managers.DragManager;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.xml.SimpleXMLDecoder;
    import mx.utils.ArrayUtil;
    [Bindable]
    public var Images:ArrayCollection;
    protected function toggleBtn(event:MouseEvent):void
    if(btn.label== 'Open')
    panelOut.play();
    else
    panelIn.play();
    protected function initiateDrag(event:MouseEvent, value:String):void
    var dragInitiator:HTML = event.currentTarget as HTML;
    var dragSource:DragSource = new DragSource();
    dragSource.addData(value, 'value');
    var dragProxy:HTML = new HTML();
    dragProxy.location = event.currentTarget.location;
    dragProxy.width = 100 ;
    dragProxy.height = 100 ;
    DragManager.doDrag(dragInitiator, dragSource, event, dragProxy);
    private function dragEnterHandler(event:DragEvent):void {
    var dropTarget:VBox =event.currentTarget as VBox;
    if (event.dragSource.hasFormat('value')) {
    DragManager.acceptDragDrop(dropTarget);
    private function dragDropHandler(event:DragEvent):void {
    var value:String = event.dragSource.dataForFormat('value') as String;
    bigImage.location = "assets/Big_Html/"+value;
    ]]>
    </fx:Script>
    <mx:Canvas id="panel" width="1013.95" height="202" y="10.3" backgroundColor="#000000" x="0.05">
    <mx:TabNavigator x="2" y="0" width="994" height="181">
    <s:NavigatorContent label="Eerste" width="100%" height="100%" id="navigatorContent">
    <mx:HBox width="992" height="137">
    <mx:Repeater dataProvider="{getData.lastResult.gallery.image}"
    id="rep" width="991" height="137">
    <mx:HTML x="228" y="10" width="113" height="112" location="assets/Small_Html/{rep.currentItem}"
    mouseMove="initiateDrag(event,event.currentTarget.getRepeaterItem())" >
    </mx:HTML>
    </mx:Repeater>
    </mx:HBox>
    </s:NavigatorContent>
    <s:NavigatorContent label="Tweede" width="100%" height="100%">
    </s:NavigatorContent>
    </mx:TabNavigator>
    <mx:LinkButton id="btn" width="100%"  height="21" 
       label="Open"
       click="toggleBtn(event)" enabled="true" x="-3" y="179"/>
    <!--Add the content of your sliding panel here  -->
    </mx:Canvas>
    <mx:Canvas>
    </mx:Canvas>
    <mx:VBox width="995" height="508" backgroundColor="#000000"
    horizontalAlign="center" verticalAlign="middle"
    dragEnter="dragEnterHandler(event)"
    dragDrop="dragDropHandler(event)" x="19" y="250">
    <mx:HTML x="83" y="44" id="bigImage"/>
    </mx:VBox>
    <fx:Declarations>
    <mx:Move id="panelOut" target="{panel}" yTo="0" effectEnd="btn.label='Close'"
    duration="1500" easingFunction="Bounce.easeOut"/>       
    <mx:Move id="panelIn" target="{panel}" yTo="-180" effectEnd="btn.label='Open'"
    duration="1000"  easingFunction="Bounce.easeIn"/>   
    <mx:HTTPService id="getData"
    url="SWF.xml" />
    </fx:Declarations>
    </s:WindowedApplication>
    The goals of the application are:
    1     Getting a repeater filled with HTML pages get generated from an XML file
    2     Fitting the repeater in a box that can be hidden
    3     Open HTML pages from the repeater by dragging them into a bigger HTML component
    The first two points work great, no problems there. But the third is a bit more more demaning.
    I set off trying to get this to work with images and that worked  just fine. Apart from not being able to see what i'm dragging, minor issue. Now i try this with the HTML component things start to change. I guess this has to do with the fact that the mouse pointer interacts with the page shown in the HTML component rather then with the HTML component itself.
    Can anyone help with this problem. If not i guess i'm going to work with images in the repeater, that should work.
    Thanks in advanced for any input,
    Daniel

    No such component in 2.0.  See http://blogs.adobe.com/aharui/2008/01/html_and_flex_1.html for more info.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Accessing the links in a HTML component

    hello.I'm using a HTML component in my application. I would like to drag and drop some links from the HTML component into a datagrid for instance. When I hold the mouse clic and move the cursor, theres a grey faded frame with the link inside, so there must be some way to access this information. Any idea how i could do that ? Thank you for any assistance.

    Thanks Stephen,
    In this case we want to use external links. For example we write a short headline and intro and then link to another page where you can read the rest.
    I have a lot of customers who wants to edit this kind of links by themselves so I hope you will look into this as quickly as possible :-)

  • Viewing flash based website in HTML component of AIR APP

    Hello,  I've got an air app where I'm trying to use the Html component to load up a flash website.  Problem is that the website starts to load (I can see the preloader) and then the html component just goes blank.  I wrote the html page I'm trying to load so I went in and did some trimming of javascript stuff that I didn't really need that I thought might be causing the issue, but, no dice.  I'm also catch uncaughtScript errors from HTML, and there are none.  Anybody have any ideas?  The flash on the page that I'm loading only required flash player 8, so I'm thinking that shouldn't be an issue.  The page I'm trying to load is www.socialsaga.com/air_index.php
    Here is my little mxml file that won't properly display the site.
    <mx:Panel title="Video Storage" xmlns:mx="http://www.adobe.com/2006/mxml" enabled="true" visible="true" width="100%" height="650"> <mx:Script>      <![CDATA[           public function showDOM(ev:Event = null):void {                var indEv:Event = ev;           }                      public function uncaughtException(ev:Event = null):void {                var whatException:Event = ev;           }      ]]> </mx:Script>      <mx:HTML uncaughtScriptException="uncaughtException()" htmlDOMInitialize="showDOM()" width="100%" height="100%"  location="http://www.socialsaga.com/air_index.php" id="htmlOne"/> </mx:Panel>

    That was a waste of a couple hours.... The reason it was not redering is because I had a glow filter effect on a parent
    displayobject in the app... Really weird, cause html stuff would load, but flash would not show up.

  • Priority of pdf opened with in HTML Component with Menus

    Hi,
      We have a group of menus poistioned in sequence. Below the Menu one HTML component is there to display html files and pdf files. If any pdf is opened in html component and if I try to open drop dowm menu the menu is displaying below html component.
    Please reply me at the earliest.
    Thanks & Regards
    Pradeep

    Hi,
    When you say the entire content, do you mean some parts of the pdf are not getting displayed or is it going out of the screen?
    Please send a pdf you are having issues with on chmaheshatadobedotcom, it will help us investigating the problem.
    -Charu

  • Help. How do you TAB from HTML component to applet (and back) ?

    How can one tab between applets in a browser, and from an applet to an HTML component?
    For example, I have the following in my page in decending order:
    an HTML text field,
    an applet containing two components,
    and another HTML text field.
    When focus is on the first HTML text field pressing TAB should shift focus to the first component of the applet, the next TAB press shifts focus to the second component of the applet, and the next TAB press shifts focus to the other HTML text field. Then another TAB press cycles back to the first TEXT field.
    I can handle the tabbing within the applet using the FocusManager, but how can I get the applet to receive focus on a TAB from the browser, and once the applet has focus, how can I give focus back to the browser when a TAB occurs from my last applet sub-component?
    At the moment a user has to click on the applet before he can tab in it, and then click outside it to tab in the html again.
    Any help appreciated, as I cant find any reference to how to do this apart from other people asking the same but getting no replies.
    Thanks,
    Menno

    I see what you are saying. Either use javascript with LiveConnect or go all applets.
    What we are actually doing at the moment is trying to componentise using small applets passing data via InfoBus. So I guess we could use only applets as you suggest. Either with getAppletContext, or we could have a data item on the InfoBus which contains the name of the required in-focus applet, and all applets listen to see if it is their name, and if so request focus.
    I'm suprised applets are not tab-able between by default. I would have thought this was a common requirement.
    I'll look into LiveConnect as well, and let you know how we get on.
    Cheers,
    Menno

  • Tabbing from applet to applet, HTML component to applet, and back

    How can one tab between applets in a browser, and from an applet to an HTML component?
    For example, I have the following in my page in decending order:
    an HTML text field,
    an applet containing two components,
    and another HTML text field.
    When focus is on the first HTML text field pressing TAB should shift focus to the first component of the applet, the next TAB press shifts focus to the second component of the applet, and the next TAB press shifts focus to the other HTML text field. Then another TAB press cycles back to the first TEXT field.
    I can handle the tabbing within the applet using the FocusManager, but how can I get the applet to receive focus on a TAB from the browser, and once the applet has focus, how can give focus back to the browser when a TAB occurs from my last applet sub-component? At the moment a user has to click on the applet before he can tab in it, and then click outside it to tab in the html again.
    Any help appreciated, as I cant find any reference to how to do this apart from other people asking the same but getting no replies.
    Thanks,
    Menno

    Well, I think it is both a Java & HTML problem.
    When you TAB from HTML there must be a way to TAB to the Java applet, and when you TAB from the applet there must be a way, when you are on the last component within the applet, to TAB back to the HTML components.
    Anyone know how?
    Cheers,
    Menno

  • How to get the result of auto detecting of text-encoding in HTML component.

    Hello.
    I just run in to the wall.
    I've hard that a HTML component automatcally detect the text-encoding of a HTML page loaded,
    and it supposed to be detected through Binary data of its HTML source code.
    I wonder, if there is any variable or function to get the detected text-encoding like UTF-8, iso-8859-1 or something like that.
    I'm glad for any response.
    thanks.

    There is TEXT_IO package in forms. For more help use the Oracle Form specific forum.

  • AIR HTML component problem

    I am using the AIR HTML component to load various website
    directories with. However, any directory that gets loaded into the
    HTML control that uses CAPTCHA, only loads maybe 2 pixels high
    worth of the image. Is this a bug with the HTML control itself, or
    have I failed to instantiate something? To see what I mean, try
    loading this URL into AIR's HTML component.
    http://www.mygreencorner.com/submit.php

    I might add that this is flex 3 Retail version, not the beta.
    Seems to work in the flex 3 milestone 4 beta.

  • Contents of HTML title Tag not rendering in my AIR HTML component

    I have an Air Application that uses a HTML Component. The HTML page that the component is rendering includes images with title tags. The tags render fine outside the Air Application, but when run in the AIR application, they do not render. Any help when this issue would be greatly appreciated.

    what html component?

  • Contents of HTML title Tag not rendering in AIR HTML component

    I have an Air Application that uses a HTML Component. The HTML page that the component is rendering includes images with title tags. The tags render fine outside the Air Application, but when run in the AIR application, they do not render. Any help when this issue would be greatly appreciated.

    what html component?

  • Overlapping with html component

    Hi,
    Html component overlaps dropdown menu bar i.e when pdf is opened with in html componenet
    I have a problem with html component in flex...
    I have 12 drop down menus on top of the page...
    On click of item in dropdown the corressponding file opens in html component....
    There is no problem if its html file file....
    But  if pdf opens in html component the dropdown menu goes behind the pdf file....
    i.e  pdf file in html component overlaps drop down menus...
    Pls let me know how we can overcum this.....
    Thanks & Regards

    I never did find a solution for this.  The Reader just doesn't support it.  What I ended up doing back then was to use ColdFusion's CFPDF tag to automatically convert each page in the PDF to an png, then do the touch gestures on the pngs.
    Don Kerr

  • Can I create a HTML component?

    I haven't actually used/configured the IPlanet portal, but I have used Websphere. A collegue of mine said that we couldn't create any HTML component? and it took him 2 days to put a HelloWorld Servlet into the portal? it sounds really ridiculous if it's true?
    Thanks & regards
    Thinh

    I really dont know what do you mean by HTML component but I dont think its very hard to deploy a servlet and make it work on portal server. Actually, you can deploy a servlet as a channel in portal or just deploy a servlet to web server which is embeded by portal. if you have the experience of writing servlet, I believe it would not take you more than a hour to make the hello world servlet work. good luck.

  • HTML Component issue?

    No "title" attribute support inside HTML component in AIR application?
    For example, we have some text in our <mx:HTML> like this:
    <html>
    <body>
    [ <a href="http://domain.tld/" title="Some hint text for this link" onmouseover="this.style.color='#f00'" onmouseout="this.style.color='#0f0'">Megalink</a> ]
    </body>
    </html>
    And when we run our application and move cursor over link, color will be changed (so, mouse events handles correctly), but "Some hint text for this link" hint/tooltip will not be shown...
    Bug/Feature/Misconfiguration?!?

    http://www.w3.org/TR/html401/struct/global.html#adef-title

Maybe you are looking for

  • IPhoto 6 Can't Edit Photos

    I've just installed iPhoto 6 (and used 5, 4 etc), and I find that I can't Edit my pictures. When I try to edit a seleced picture in the Library, (via context menu, double-click or toolbar), either nothing happens, or the edit window opens, with thumb

  • I1111 for SC (Item in Transfer Process)

    Hi, Business is using SRM 3.0 ECS. Scenario is that User is creating Shopping cart thru Catalogue and there is Approval process for SC. Once the SC gets approved PO is created by the system.(I1113).For this perticular SC error is Item in transfer pro

  • Scale bug during export in CS3!!!

    I have a slideshow which all of the pics are scaled with the option "scale and crop edges". When I preview it in encore it looks perfect. The problem occurs when I export/builds the dvd, flash or whatever. When I playback the slideshow it looks like

  • Error Loading Jar file.

    I am using Java stored procedures in my project. I am running oracle 9.2.0.4. Part of my program parses an xml using xerces. So I tried to load the dependencies as and when i got unresolved error. However after loading all the dependencies i still co

  • What the bleep does "Remove and check cartridge" mean? (officejet 6110xi all-in-one)

    I got a printer (as above) in a yard sale.  When I first turned it on, it had an error message: "Remove and check cartridge".  I pulled out and looked at the cartridge, nothing seemed wrong (except perhaps the mildly inexplicable twist tie).  What do