How to keep the cursor in short to a TLF in ScrollPane?

How to keep the cursor in short to a TLF in ScrollPane? Consider this:

textFlow.addEventListener (UpdateCompleteEvent.UPDATE_COMPLETE, tlfUpdtHandler, false, 0, true);


private void tlfUpdtHandler(e:Event):void {}
textFlow var = e.currentTarget;
var containerController = textFlow.flowComposer.getControllerAt (0) as ContainerController;
var contentBounds:Rectangle = containerController.getContentBounds ();
var tlf_mc = containerController.container;
containerController.setCompositionSize (containerController.compositionWidth, contentBounds.height);
var sp:ScrollPane = tlf_mc.parent.parent;
TPI Update();
trace (Math.ceil (SP.verticalScrollPosition), Math.ceil (sp.maxVerticalScrollPosition), sp.verticalScrollPosition, sp.maxVerticalScrollPosition);

sp.verticalScrollPosition = sp.maxVerticalScrollPosition;

}

I can't do this as the scroll position will always be in the last line. I would like the scrollpane to scroll to the line where the content is typed.

Kindly help out me with pointers.

Thank you.

Sabine

Thanks I understand now.  I'm not familiar with the fl classes but here goes.

(1) using the NaN being the height of composition that tlfUpdateHandler keeps the cursor in view.  It worked with a few simple tests - there may be a few missing details.  I call sp.update so that it catches the total height changes?

private void tlfUpdtHandler(e:UpdateCompleteEvent):void
{
find the current activePosition
var activePos:int = e.textFlow.interactionManager.activePosition;
If (activePos == - 1).
return;
           
var tfl:TextFlowLine = e.textFlow.flowComposer.getLineAt (e.textFlow.flowComposer.findLineIndexAtPosition (os activeP));
           
If his view not to scroll into view
If (sp.verticalScrollPosition > tfl.y: sp.verticalScrollPosition + sp.height)<>
sp.verticalScrollPosition = tfl.y - 20;    just a number for him give a certain margin above
}

(2) If you do not use NaN as the height of the composition (less accurate but works better) I don't think that you will be able to use ScrollPane.  TLF automatically scrolls the lines inside the Sprite using the limits of composition.  Instead, you need to instantiate a control ScrollBar and synchronize the contentBounds with maximum heights and also synchronize the scroll positions.  TLF generates a "scroll" event every time it scrolls the content.  ContainerController has a r/w for verticalScrollPosition properties.

Hope that helps

Richard

Tags: Adobe Open Source

Similar Questions

  • Vertical forms that parade with the tab to keep the cursor on the screen

    I have a high vertical shape that is roughly 2000px in height. If the user moves through the fields, they "fall" the bottom of the screen. Which means, the cursor moves in a field out of sight but the scroll bar will not push down automatically to compensate and keep the cursor in view. Ideally the scroll bars to move with the cursor as they do when a tab in a traditional html form. Any help is appreciated. Thank you.

    Lokesh-


    I had to do this thing myself. A bit like it to be registered in the normal...

    Anyway, here's an example application that does what you try to do:

    http://www.Adobe.com/2006/mxml">


    private void checkPos(target:Object=null):void {}
    var yPos:Number = target.y + target.height;
    Debug.Text = "";
    var shiftAmt:Number = 0;
    If {(yPos>cont.verticalScrollPosition+cont.height)}
    shiftAmt = yPos-(cont.verticalScrollPosition + cont.height);
    Debug.Text += "Move down: '+ shiftAmt + '\n';"
    } ElseIf (yPos<=cont.verticalScrollPosition)>
    shiftAmt = yPos-(cont.verticalScrollPosition + target.height);
    Debug.Text += "Move to the top: '+ shiftAmt + '\n';"
    }
    cont.verticalScrollPosition += shiftAmt;
    Debug.Text += "yPos:" + yPos + "display space: '+ cont.verticalScrollPosition +' - '+ (cont.verticalScrollPosition + cont.height);"
    }
    ]]>








    If your form has a TON of controls, then you can just make a function to automatically bind the listener in actionscript... dunno which is easier. Writing onFocus = 'blabla' for each component is a drag, but it's simple...

    If there is an easier way to do it, I hope that someone will say so, because this is how I do it and it's not very fun.

  • How to keep the Safari in full screen, when it opens instead of small rectangle I enlarge them with green button and how to keep the presentation of upper task bar without always having to lower

    How to open safari in its entirety in a small rectangle and then having to enlarge.  It started to happen.

    How to keep the top toolbar in view rather than having to lower whenever necessary

    Drag the bottom right and left corners of the window to enlarge it to fit the screen.

  • After asking a website, I should keep the cursor moving on the working surface of firefox to get the next page if I am not it times out, I ask her

    After requesting a web page (site), I have to keep the cursor moving on the surface of work Firefox while the page is loading, if I do not have the demand for time and I ask her again. Why is there a setting or something. This was not always the case that in the last year, I would say.

    Hello khbaumsr, several other affected users have reported that it was a problem caused by malicious software on their pc.
    Please run a full scan of your system with the free version of malwarebytes and adwcleaner (these two security tools are free).

    Fix Firefox problems caused by malicious software

  • I want to open a new tab, but keep the cursor in the adressbar. Right not every time I open a new tab, I come to a page with google search and the firefox logo.

    Everytime I open a new tab, I'm greeted by this page

    http://blog.Mozilla.org/UX/files/2012/05/Firefox-beta-13-redesigned-About_Home-Page1.PNG?128c42

    Is a small problem for me, because when I want the cursor at the beginning in the adressbar. So, if for example, I opened a new page, I type in imdb.com I receive directly on imdb.

    Today, however, with the Home tab firefox screen. I have to do a google search for imdb.

    A small problem perhaps, but enough to be annoying.

    Is there a way to move the settings or something similar, and keep the cursor in the address bar after you open a new tab?

    Hello

    If you only want the new tabs do not have home page, you can change it by going in your Subject: config page and replacing "browser.newtab.url" Subject: vacuum. For me at least, if I open a new tab on a white page, the cursor remains the address bar.

    In order to change your Firefox Configuration please follow the following steps:

    1. In the address bar, type Subject: config

    and press enter. The subject: config "this might void your warranty!" warning page may appear.

    1. Click on I'll be careful, I promise! to keep the comments: config page.

    If you also want to change your home page to a blank page, you can do so in virtue:

    • (on Windows) Tools > Options > general, or
    • Menu

      > Options (preferences on Mac and Linux) > general

    Then change the dropdown to "when Firefox starts:"so that it is set to 'Show a blank page'.»

    Note that you can continue to do research on the awesome bar and search bar where you want to do a Google search.

    Does this solve the problem? Let us know.

  • I made my largest site and how can keep the same size for all other sites?

    I did the 2 larger site and how to keep the same size for all pages when I re - open the web browser?

    You can use an extension to set a page zoom and the size of the default font on the web pages.

  • How to keep the Safari line at the top of my screen to disappear?

    How to keep the Safari line at the top of my screen to disappear?

    See the toolbar of Safari mode full screen?

    Launch Safari.

    Click on the Green navigation button to enter full screen mode.

    Move the mouse to the top of the screen.

    When the menu bar and the toolbar drop-down, click on 'View' in the menu bar of Safari.

    In the drop-down menu choose «Always see the toolbar in full screen»

  • How to keep the Macbook pro screen and cin on position?

    How to keep the Macbook pro screen and computer in position 'on '.  I don't want the computer shuts down or cut unless I ask him to...

    If you talk to keep your machine to fall asleep, take a look at the caffeine.

  • How to keep the input value after click on the back button being the ADF

    Hi expert,

    I have a case currently the adf:

    1. I put 'value' in the Label 1

    2. I click on the next button

    3. I click on the "back" button

    4. the 'value' went from 1 label.

    How to keep the 'value' of 1 tag after I click back, do you have any suggestions?

    Kind regards

    Ricky

    Hello

    Where you store the value? Try to store it in a variable pageFlowScope or a property of the pageFlowScope bean.

    value = "#{pageFlowScope.testVar} '"

    value = "#{pageFlowScope.testBean.testVar} '"

    Kind regards

    Ruben.

  • Does anyone know how to keep the name of an image embebed in Illustrator v?

    Does anyone know how to keep the name of an image embebed in Illustrator v?

    Add the file name as a Note in the Panel. From a built-in file is just a raster image in GOT it, there is no links to follow.

  • How to keep the HTML text (i.e. Peragraph) according to the proportions?

    How to keep the HTML text (i.e. Peragraph) according to the proportions?

    Do not disturb (coming down / up) even a letter / word

    Do not disturb (coming down / up) even a letter / word

    Due to levels of zoom browser and personal user settings, there is no possible way to ensure an alignment of text on the web, unless you use images of the text.  Of course, this isn't an option because images of text cannot be indexed by search engines, screen readers or translators of language.

    Nancy O.

  • Animate dashboard. How to change the cursor of the animated symbol (no picture)?

    Hi, could you tell me please how to change the cursor in internship at the animation symbol and label goto inside when click on and release.

    For example, I want to create hammer striking the rock, my cursor should change when I'm on the stage and the hit, when I am pressing the button of the mouse and goto the first position when released.

    Thanks for the help =)

    Hello

    This demo file can help you: can I use a symbol animated acting as a mouse cursor?

  • How to keep the (update or delete, insert) triggering action in the table?

    Hello experts,
    I have create a trigger on update, delete or insert. I insert records into a table which records insert, update, or delete.
    I would also like to insert the revival of whick action the trigger as update, delete or insert.

    Here's my trigger code.

    create or replace trigger BOM_HISTORY_TRIGGER
    after update or delete or insert on BOM_HISTORY
    for each line
    Start

    insert into bom_history (BOM_MOD_CODE, BOM_ASSY_CODE, BOM_ASSY_QPS_old, BOM_ASSY_QPS, PPC_SRL_ #, ITEM_ENTR_BY,)
    ITEM_MOD_BY, MOD_DATE, ACTION)
    values(:Old.) BOM_DIV_CODE,: old. BOM_MOD_CODE,: old. BOM_ASSY_CODE,
    : old. BOM_ASSY_QPS,: new. BOM_ASSY_QPS,: old. PPC_SRL_ #,: old. ITEM_ENTR_BY,
    : old. ITEM_MOD_BY, SYSDATE, 'delete')
    END;

    HOW to keep the action in the table.

    also, there is error:
    WARNING: Trigger created with compilation errors.

    Please help to fix it.

    Thank you best regards n
    Yoann

    >
    insert into bom_history (BOM_MOD_CODE, BOM_ASSY_CODE, BOM_ASSY_QPS_old, BOM_ASSY_QPS, PPC_SRL_ #, ITEM_ENTR_BY,)
    ITEM_MOD_BY, MOD_DATE, ACTION)
    values(:Old.) BOM_DIV_CODE,: old. BOM_MOD_CODE,: old. BOM_ASSY_CODE,
    : old. BOM_ASSY_QPS,: new. BOM_ASSY_QPS,: old. PPC_SRL_ #,: old. ITEM_ENTR_BY,
    : old. ITEM_MOD_BY, SYSDATE, 'delete')
    >
    Unless I've counted wrong you have 9 mentioned columns but try insert 10 items.

  • How to keep the environment setting

    We need to set disable javascript.

    But,

    after update, it turns to activate.

    You please show me

    How to keep the environment-setting before and after the update of Adobe reader.

    Thank you

    JavaScript is enabled by default in the browsers. Turn off (disable) is a manual process, which must be done by the end user.

    JavaScript must be enabled in order to use the Adobe Download Manager.

    You can download the Installer http://get.adobe.com/reader/enterprise/ offline without having to activate javascript. But there IS NO Adobe Reader (or Adobe Updater) affecting control javascript in browsers, or disable it automatically afer a download.

  • How to keep the metadata after Correct camera distortion filter?

    Hello

    Anyone know how to keep the metadata information after you have used the Correct camera distortion filter?

    In other words:

    When I need to correct the photo with good camera distortion to the menu Filter option I can't keep the metadata to the final table.

    After correction, I cut the useful part with the rectangular selection tool, and then I chose the file, new, Image to the Clipboard.

    Either the format file that I choose to save the metadata information has disappeared.

    I tried to export the metadata from File, FileInfo, information, and then import the metadata (XMP file) but no result.

    Someone at - it an idea to solve this issue

    Thank you

    This is probably because your using the Clipboard that discards the data.

    Try to crop your photo and recording. You can always cancel the harvest after saving if you want to do something in the photo.

Maybe you are looking for

  • HP TouchSmart window 7 drivers x 64 15-n013dx

    I need drivers Windows 7 x 64 for this laptop! I know it is installed with Win8 and only Win8 drivers are provided on the HP site, but my client prefers 7. Update Windows 7 supports usually most drivers for laptops, but it seems that I have both the

  • Error code is 8024200d, cannot install KB2564958

    It cannot install an inportant update.  Error code is 8024200d.  All other updates installed correctly

  • Smartphones blackBerry how to cancel auto text?

    could not find it... I want to type the words without automatic text Thank you

  • How to change the font, size, color for long-term

    I like sending an e-mail using color. I got Windows 7 earlier this year. I had XP. At the same time, I changed the font, size and color, and there staed like that. However, I tried to change it again and I spent weeks trying. I know that they can be

  • HP 710 C WIN 7 64 BIT - problems with printing

    Hello I have win7 64 bit and problems with the installation deskjest hp 710 c. I've used drivers from microsoft windows update and still my printer stay calm. Now, I have no idea what to do... ? For example: I open the word document - press 'Print' -