is there a way to get the index of the html text field cursor position

I'm working on a block of text as MC with 'insert text at position X' and 'Find and replace' can someone tell me how to find the index of an html text field cursor. Selection.getBeginIndex (), Selection.getEndIndex (), Selection.getCaretIndex () as far as I know these methods only work with text and not htmltext.
What I'm trying to do, it's affecting different parts of the chain to the variables so that I can combine in order to restore my html string.

ray1872:

If I understand correctly, you want the corresponding position in the
another index of the caret htmlText property (who, like you, has no on the)
position in the plain text of the textfield content version).

Here's how I'd do. It is perhaps easier or more effective
way (using objects XML etc.), but I don't know it. You could conduct all
your search string in plain text and then convert the result of
the positions of html. I didn't build this to accept negative parameters
for the parameter pos (for example, end of string towards the back), but the
function could be adapted to do this also if necessary. The test data is
not good html from a text field, but it does not really matter what he
is as long as its formatting correctly. It separates only tags of
content to allow apples to apples comparison.

some test data
var testStringXML = ""Hello I can't tell you hOE happy I mod.'; "
var undecoratedString = Hello "I can't tell you how happy I am.";

the conversion function
function findDecoratedPosition(pos:Number,_xmlString:String,_test:Boolean):Number {}
anything between '<' and="" '="">' should be excluded from the search in plain text.
create a table of elements of array (n = 2), consisting of tag and then plain text
requires xml/html properly put in the form
var tempArr:Array = xmlString.split (')<>
for (var aa = 0; aa
tempArr [aa] is [aa] tempArr,.split(">").;
}
remove the first and last elements in the new array (they are empty)
tempArr.pop ();
tempArr.shift ();
find the location of corresponding plaintext and calculate the position "decorated."
var retPos:Number = 0;
var posCount:Number = 0;
for (var aa = 0; aa
retPos += tempArr [aa] [0] .length + 2 + tempArr [aa] [1] .length;
+ 2 allows you to lack< and="">
posCount += tempArr [aa] [1] .length;
If (posCount > pos) {}
return (retPos + (pos-posCount));
}
}
out of range
Returns - 1;

}

test code:
for (var aa = 0; aa
var altPos = findDecoratedPosition (aa, testStringXML);
trace (undecoratedString.charAt (AA) +"position" + aa + "in clear corresponds to the position" + altPos + "in decorated version [" + testStringXML.charAt (altPos) + "" "]" ");

}

Tags: Adobe Animate

Similar Questions

  • Is there a way to get the HTML code of my Muse whole site?

    I posted this question earlier, but I have not received a solid answer on "How can I get the HTML source code to my site."

    That's what I did:

    I chose "Export to HTML" for my site in Muse CC 2014, but I gives me a folder with several items inside.

    Here's my question: How can I get the HTML on my site in order to be able to paste my site in an HTML editor and upload it to a site?

    I need to download my site in the HTML of a Web site editor. I know that I can use a text editor to get the HTML code for the site, but I don't know how to get the HTML of "my site." When I export to HTML, I get only one file with content inside.

    What I need is just the HTML source code for the 'whole site' I did so that I can paste the site I created in Muse in a HTML editor.

    Thank you!

    I see, you will not be able to use the Muse like this. You must be able to have the full html of tact folder structure.

    The only way you would be able to do would be to copy all of the HTML files and create an exact structure like it on your server. Your online system probably who can't stand by the sounds of it.

  • Is there a way to get the text to reformat then I Zoom in to read an article.

    Is there a way to get the text to reformat then I Zoom in to read an article, so I can't do a pan on?

    Unfortunately not - this is one of the disadvantages of pinch to zoom - makes the biggest full page

  • I try to install vista on my laptop but a letter of the key is not visible, all the other parts are very well including the serial code, is there another way to get the key of the other information?

    Taché product key

    Hello

    I try to install vista on my laptop but a letter of the key is not visible, all the other parts are very well including the serial code, is there another way to get the key of the other information? The laptop currently has non-OS I've tried to reinstall.

    Thank you

    Scott

    Product keys are bit-agnostic - they don't care if it's 32-bit or 64-bit.

    However, cannot legally use the recovery disk from one computer to a different constructor machine - as other licenses are not properly paid..

    There is nothing nonetheless to try all possible variations on the absence of character (there are only 25, after all the )

    Other than that, your best option is to contact the manufacturer and order a set of recovery disc for the machine. I do no download available for Vista with SP2 - but you can download Vista with SP1 and create the disc.

    http://www.heidoc.NET/Joomla/technology-science/Microsoft/57-Windows-Vista-direct-download-links

  • Is there a way to get the key on the dvd?

    I have one of the signature of windows 7 dvd sets complete the house party promotion my system which featured 64-bit died and I would like to install it on my new drive, but could not find the dvd cover with the product key to this issue is there a way to get the key on the dvd?

    Nope. There is no key on the DVD. Without the lid, you are out of luck.

  • Is there a way to get the first Pro CS6 with still now I can't find the previous, offered versions with the subscription of the CC 2015?

    Is there a way to get the first Pro CS6 with still now I can't find the previous, offered versions with the subscription of the CC 2015? What is recommended for creating DVDs with interactive menus?

    Instructions again, cloud or version https://forums.adobe.com/thread/1992717 serial number
    -a of notes on different versions of cloud and step by step on these differences
    -contains information about the separate library download which is necessary
    -CS6 is the last reminder, see here #8 why http://forums.adobe.com/thread/1337952?tstart=0

    Still and 10 Windows https://forums.adobe.com/thread/2015461 use the compatibility mode of Windows 8
    problem/solution to install Encore CS6 https://forums.adobe.com/thread/1934087

  • Is there a way to get the name of the currency of the members of the outline

    Guys,

    Is there a way to get the names of the currencies of the members. I don't see any VB API function to do this. How can I get it?

    See you soon,.
    PM

    Mikki, if you want to just take one of your dimension of 'Country' and see what the currency is associated with him, call it EsbGetMemberInfo or EsbOtlGetMemberInfo will do (at least, according to the docs, do not remember having ever done).

    Only valid in > = 11.1.2. but if you export the outline to XML go MaxL, information is here too.

  • Is there a way to get the number of the current item?

    In an article with multiple instances: is there a way to get the number of the current item? If for example, I'm on the 3rd point, is it some sort of integrated "GET CURRENT NUMBER REGISTRATION" which would return a '3' to the program?

    Thank you

    Published by: WayneFMcKinstry on April 9, 2010 10:50

    If I get you correctly in tabular element that you want to know the current record or current, you can try this...

    For the current record

    :SYSTEM.CURSOR_RECORD;
    or
    :SYSTEM.CURRENT_RECORD;
    

    for the current element

    :SYSTEM.CURSOR_ITEM;
    

    -Clément

  • Is there a way to get the CF work around the original file?

    When I download a file in cf, cf renames the file if the file already exists. Is there a way to get the CF work around the original file?

    Yes of course nothing.

    The documentation tells you even this.
    http://livedocs.Adobe.com/ColdFusion/8/htmldocs/Tags_f_10.html

    I will even make notice that the attribute "nameConflict" is the one that you
    you want to read.

  • Is there a way to way to a mobile site redirection script in the header HTML in Muse? Is there a way to accsess the html header in Muse?

    Is there a way to way to a mobile site redirection script in the header HTML in Muse? Is there a way to accsess the html header in Muse?

    Best regards

    Thor Ivar

    Hello

    If you are ready to insert a script in the header of the Page header, follow these steps:

    1. in Design view, open the page or master page.

    2. go to Page > Page Properties > metadata > paste the script in "HTML for."section.

    Apart from using mobile site redirect script, you can take also relating to the possibility of creating a mobile layout in muse. Please see the links in the thread below:

    Hi, can someone help me, I did my first page in Muse, and I did just for computer, do I Tablet and phone, I have to do?  THX

    Regards

    Vivek

  • Is there a way to get the image out of my iPod 4th generation without knowing / being able to enter the password

    I've had my iPod for about 6 years. About 2 years ago, the screen broken to the point of not being able to enter my password, and since then, I forgot it all together. The power button does not work. I was wondering if there is a way to get the pictures off of it and on my computer.

    Thanks for your help.

    Additional info, the power button does not work.

  • Qosmio F30: Is there a way to get the remote to work directly with built in receiver

    My remote control Media Center only works when I plug the Receiver USB on my Qosmio F30 yet will work directly to the laptop with the vista media center pre program.

    Is there a way to get my remote to work directly on the built-in receiver?

    Steve.

    Hi Steve

    There is unfortunately no way to do it. Qosmioplayer is also part of the media offered by this book, and as you know this small Linux based application runs without booting the operating system. Due to this USB port can not be used (external receiver) and because of this one way remote control with Qosmioplayer is infrared receiver window.

    I'm not a technician and can explain you why this little infrared window is not used with the operating system running but, I'm sure, there must be a technical reason for it. Anyway, there is nothing to do, and you have to live with it. :(

  • Is there a way to get the old Office mate (Clippy) in Windows 7?

    I hate to be "Clippy" (or is this Clippie?) of XP and I would like to know if there is a way to get the old Office Assistant in Win7.

    They were actually disabled in 2001 with the implementation of 'Microsoft Office XP' and completely deleted for good at the end 2002 with the release of Microsoft Office 2003.

    You can restore to 2003 with some changes to the system registry and the replacement of prudent file, but it is not supported.  And this can be done at all in Office 2007 with impatience.
  • Is there a way to get the data for submission of form of eloqua using the REST API?

    I was wondering if there is a way to get the data for submission of form of eloqua using the REST API?

    Thank you

    On the page that egan related, there is a 'RawData' field for FormSubmit activities. In this area, the raw sending the form query string is returned.

    Whatever it is, you can get this info from the activities of the API block, or the endpoints data Rest API.

  • Is there a way to get the handful of handful of composition layer?

    Hello

    I have an API call to query the bounding of the layer composition, however, I find no practical way to get a handle of the layer in the composition encompassing.

    is there a way to get a handle of composition, and then look on it as a layer (in some other publication)?

    Best regards

    Yuri

    If I read you correctly, you mean if a computer is are not nested in other

    Comps.

    If so, then there is no API for this list "used in". you will need to

    read the draft and check the layers of each model and compare the source.

    Start by getting the project item for the model you're looking for

    using AEGP_GetItemFromComp().

    then analyze the project with AEGP_GetNextProjItem(), check the type of each element,

    and if it's a model to digitize its layers using AEGP_GetLayerSourceItem().

    is the source of the layer with the source of the model and you will know if it is

    used here.

Maybe you are looking for

  • Questions of Time Machine

    I have a MacBookPro Retina Display 2012, running OS X 10.11.6. I tried to use Time Machine to back up this system (a single) on TWO external drives.  Lately, I am having some problems.  In other words, when I try to restore, or even to find a file, I

  • My e-mail given security id is no longer valid. How can I change

    My e-mail given to safety is no longer valid. How to change that?

  • G6-2030SL: replacement power connector

    Hello worldMy problem is that my PC (G6-2030SL) does not load, but my charger works on my old Presario CQ60-103EL.I checked the number of spare parts for two power connectors, and they are different.Can I replace my with presario power connector? EDI

  • Network error Digital Filing on Windows 8 using HP L7680

    Hi all I use the HP L7680, and I think one of the best features is the ease of digital archiving. I just upgraded to Windows 8 and have downloaded the last full installation on the site of HP (with so-called is Windows 8) compatible. However when I t

  • A simple way to load a pdf page into flash with as3

    Hallo,is there a simple way to load a pdf page into flash with as3 at Flash.I mean no plug in or as a class.Thank you.