Replace a string with a textBox Word key

I think no doubt about it the wrong way. My goal is to create a textField in a position of a key word in a textField and update the position based on that keyword

Example: The planet RESPONSE is the 3rd away from the Sun. (I want the ANSWER keyword to generate a text field in the posion even in the question).

My problem is trying to find a coherent solution to a dynamic list of questions.

My code so far:

var str:String = "Hi"it is an example RESPONSE.";

var theText:TextField = new TextField();

Answer.Text = str;

addChild (theText);

theText.y = answer.y;

//!!!! my place of disorder! //

theText.x = (answer.x + theText.text.length) + str.indexOf ("ANSWER");

Thanks for any help or suggestion.

You are welcome.

and you're right: the tf should be added to the screen before their references are crushed and the tf of entry must use and Event.CHANGE, Event.TEXT_INPUT or TextEvent.TEXT_INPUT:

function keywordF(questionS:String,keywordS:String,x:int,y:int):void {}

var nextX:int = x;

var a: Array = questionS.split (keywordS);

var tf:TextField = new TextField();

addChild (tf);

TF.x = nextX;

TF.y = y;

TF. Multiline = false;

TF. Text = a [0];

tf.autoSize = "left";

nextX += tf.width + 5;

TF = new TextField();

addChild (tf);

tf.addEventListener (Event.CHANGE, textchangeF);  Create your textchangeF to check user input.

TF. Multiline = false;

TF. Text = keywords;

TF. Border = true;

TF.type = "Input";

tf.autoSize = "left";

TF.x = nextX;

TF.y = y;

nextX += tf.width + 5;

TF = new TextField();

addChild (tf);

TF.x = nextX;

TF.y = y;

TF. Multiline = false;

TF. Text = a [2];

tf.autoSize = "left";

}

Tags: Adobe Animate

Similar Questions

  • Replace the string with the formatted text

    Hello all - I'm back to my beloved project...

    I want to replace a string by a TextSelction (formatted text) and began with the famous feature of Jang FindAndReplaceString.
    Since my replacement comes from another document (sourceDoc), I edited to targetDoc activeDoc and introduced a second document (sourceDoc).
    The replacePara actually comes from a stone where he had been placed to avoid switch backwards between the documents in a book (where to find and replace) and source documents. In another function, I learned that information on the table requires the sourceDoc must remain open.

    • Of course, everything works fine until I want to insert the replacelement:
      erase line 26 is the string
    • Given that I do not insert a string, I skip lines 28 and 29 and try try line 30
    • On line 30 DocumentSource is Document object and replacePare object TextSelection. However, sourceDoc.replacePara is not set and
    • (as a result?) line 31 past the current contents of the Clipboard.

    Of course, there is a fog around me... and I need some sunshine.

    function FindAndReplacePara (targetDoc, findString, sourceDoc, replacePara, loopMax) {
      var tr = new TextRange();
      var restoreTR, frame = 0, loopCounter = 0, replacementCounter = 0;
      var findParams = new PropVals();
      var firstPgf = targetDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;
      
      tr.beg.obj = tr.end.obj = firstPgf;             //  set up the starting text range as the very beginning
      tr.beg.offset = tr.end.offset = 0;              // of the flow. We'll move straight from beginning to end.
      trSaved = tr                                    // to come back after work
    
      findParams = AllocatePropVals(2);
      
      findParams[0].propIdent.num = Constants.FS_FindText;
      findParams[0].propVal.valType = Constants.FT_String;
      findParams[0].propVal.sval = findString;
      
      findParams[1].propIdent.num = Constants.FS_FindCustomizationFlags;
      findParams[1].propVal.valType = Constants.FT_Integer;
      findParams[1].propVal.ival = Constants.FF_FIND_CONSIDER_CASE;
    
      FA_errno = Constants.FE_Success;                // errno global, to be used to track the progress of the find and replace
      tr = targetDoc.Find(tr.beg, findParams);        // and do an initial find to get started.
      
      while(FA_errno === Constants.FE_Success && loopCounter++ < 2*loopMax) { //find and replace loop as long as we keep finding
        targetDoc.TextSelection = tr;                 // set up the text range to clear the original text
        targetDoc.Clear(0);                           // clear it
        
    //    targetDoc.AddText(tr.beg, replacePara);       // insert the new text at the original beginning of the text range
    //    tr.beg.offset += replacePara.length;          //  lets jimmy the text range in memory to place it directly after
        targetDoc.TextSelection = sourceDoc.replacePara;        // paste the whole replacement paragraph
        targetDoc.Paste (0);                          // <-- Current contents of clipboard is pasted !!!!
        if(FA_errno === Constants.FE_Success) {       // increment our return counter
          replacementCounter++;
        }
        FA_errno = Constants.FE_Success;              // ...  find the next instance. We'll reset FA_errno again just in case
        tr = targetDoc.Find(tr.beg, findParams);      // something screwy happened while we were replacing text.
      }
      targetDoc.ScrollToText(trSaved);                // we're done. Restore the document to it's original area of display
      return replacementCounter;
    } // --- end FindAndReplacePara
    

    Hi Klaus,

    Thanks for the explanation. I remember something like that GetTabRange of the way back. You have been quite patient and persistent with this project, indeed.

    So, as we are dealing with ranges of text here, I think that the only simple approach is to perform a copy and paste. There is no way to save a 'formatted' in a variable. The only super precise way would be to get a data structure of each text range TextItems in the sourceDoc, then meticulously recreate every element of the targetDoc. It would be very complicated, I think, so copy and paste seems the most logical. I wonder, though, if Miss me something, because I think that maybe you would have tried already so yes (?)

    In any case, I would do something like that, from line 30 of your original code sample (code untested here):

    App. ActiveDoc = sourceDoc;

    sourceDoc.TextSelection = replacePara;

    sourceDoc.Copy (0);

    App. ActiveDoc = targetDoc;

    targetDoc.Paste (0);

    ... etc.

    Does make sense, or am I barking the wrong tree, as they say?

    Russ

  • Replace the string with quouts

    Hi all

    I use the oracle version below:

    12 c Oracle database Release 12.1.0.1.0 - 64 bit Production

    PL/SQL Release 12.1.0.1.0 - Production

    CORE Production 12.1.0.1.0

    AMT for Linux: Version 12.1.0.1.0 - Production

    NLSRTL Version 12.1.0.1.0 - Production

    I have a string like:

    0,1,5,9,10,58... so now

    I need to convert the above string in form below:

    '0 ', '1', '2',' 3'... well now

    Here, I want to add quotes to open and closing of all the numbers that are separated by a comma.

    Select '0,1,2,3' double;

    but I pulled out as:

    '0 ', '1', '2',' 3'

    Here, there are a lot of numbers in a string, but all are separated by commas.

    Thank you

    something like:

    WITH the DATA (str) AS (SELECT ' 0,1,5,9,10,58' FROM dual)

    Select regexp_replace (str, '(\d+)', q '{' \1'}')

    from the data

    /

    ?

    HTH

  • How to replace a string with asterisks? This is related to my previous post

    I guess I now replace the middle segment of which is recovered by asterisks.

    Thus, the string in the middle of "99999988" should be replaced by ' *'. Basically, I'm trying to hide the average advertising channel. The length of the original string is not known, but the first segment is 6 characters and 3 segment is 4 characters. Intermediate gum can be between 5 to 10 characters. In the example below, its 8 characters.

    Can I use functions REPLACE or TRANSALE here?
      select substr('456712999999881234', 1, 6) a,
             substr('456712999999881234', 7, length('456712999999881234') - 10) b,
             substr('456712999999881234', -4) c
      from      dual;
    Thank you

    Hello

    So, you want a chain of n - 10 b *, where n is the length of the string:

    SELECT  SUBSTR (txt, 1,  6)               AS segment_1
    ,       RPAD ('*', LENGTH (txt) - 10, '*')     AS segment_2
    ,     SUBSTR (txt, -4)                             AS segment_3
    FROM     table_x;
    

    It doesn't matter what were these characters, so you can't use TRANSLATE.

  • I can't activate Microsoft Word with a missing product key.

    I bought a second hand laptop and I can not activate Micrsoft Word 2007 with a missing product key (laptop don't have the program cd with it when I bought it).

    Tried to activate it online.

    Any kind of help would be appericated.

    Hello

    Office is not provided with a computer purchase for free.

    Most new computers for the last years came with a trial version of Office that lets 'x' number of days usuage.

    After this test times out, you will have to buy Office.

    And the product key on the cover of laptop for the Windows operating system, not for the desktop Suite.

    Here is the link for the Microsoft Store to Office products:

    http://www.microsoftstore.com/store/msstore/HTML/pbPage.Office_Category_Page?ICID=Home_4up_1_OfficeCatPage

    And you might be interested in the free Open Office Suite of Office Applications.

    http://www.OpenOffice.org/

    For any other question about Office, please repost in the Office Forums:

    http://answers.Microsoft.com/en-us/Office

    See you soon.

  • I replaced my netbook with a SSD HD and reinstalled Windows Starter with original OEM key. Now, he had become an evaluation version. How can I fix it.

    I replaced the HD with an SSD in my netbook.

    Due to the change of material (disk) I couldn't use recovery option.

    So, I reinstalled Windows Starter from scratch with the original OEM key (on the back of the Samsung netbook...

    After a delay of a licency says Windows is not is no longer valid (end on assessment) and I have to buy a new version.

    I've already paid for this edition of starter, so I don't want to buy any update.

    Samsung CAL not does not help me, because the licensecode is Microsoft.

    How can I fix it?

    How can I reactivatie this Starter Edition is assembled of original Key?

    have you enabled it? Probably the initial 30-day grace period expired.

    How to activate Windows 7 manually (activate by phone)

    1) click Start and in the search for box type: slui.exe 4

    (2) press the ENTER"" key.

    (3) select your "country" in the list.

    (4) choose the option "activate phone".

    5) stay on the phone (do not meet all the automatic guests) and wait for a person to help you with the activation.

    (6) explain your problem clearly to the support person.

    If this does not work:

    To analyze and solve problems for Activation and Validation, we need to see a full copy of the diagnostic report produced by the MGADiag tool (download and save to the desktop - http://go.microsoft.com/fwlink/?linkid=52012 )

    Once downloaded, run the tool.

    Click on the button continue, after a short time, continue button will change to a copy button.

    Click the copy button in the tool (ignore the error at this stage) and then paste (with r-click and paste or Ctrl + V) in your message.

    Please indicate the version and edition of windows from your COA. do not specify the product key.

  • want to use regexp_replace in pl/sql to replace a string containing repeat them consecutive to a words

    Hi Experts,

    I want to use regexp_replace in pl/sql to convert a string containing consecutive repeat words have only one.

    for example: "is my name and and I was waiting for waiting for what it" should be replaced by "is my name and I was waiting for it."

    Thanks in advance

    Gordon

    A slight change '(\w+\S\W)\1+' )

    Concerning

    Etbin

  • Replace the last occurrence of a word in a string

    Hello

    I need to replace the last occurrence of a word in the string. Example of form:

    "I like fruits and vegetables as" need to replace the last occurrence of 'like' that is just before the vegetables and not 'as' before the fruit.

    Something like that!

    SELECT
        REGEXP_REPLACE('I like fruits and also like vegetables','like','hate',1,2) data_col
    FROM dual;
    
  • How to replace the paragraph with a space mark

    Hello

    I received the contents of a manual in raster format, but each line of text ends with a paragraph mark. How to replace the paragraph with a mark space otherwise than by hand?

    In Word, this is pretty easy, but I don't see not any provision for it in the search box on 7.2 Frame.

    Yours,

    Michael F

    ========

    \p = end of paragraph

    \P = beginning of paragraph

    See: Help > keyboard shortcuts > keys for the search and replace

  • HP20002D19WM came with no software (cyberlink) key and certificates of authenticity for windows

    I just bought the HP20002D19WM, which came with no software (cyberlink) key and certificates of authenticity for windows. I can't use any program cyberlink with a key number to enter. Also if I would give for somereason I wonder in my number of windows I would not be able to since I have ever trevieved it

    This is the original factory specifications for your laptop HP 2000-2d19WM. All Cyberlink OEM software should work without key, because it is not mandatory for the installed OEM mass products. Regarding the Windows product key, see Activation of Windows 8 product;

    • OEM Activation 3.0 (OA3) at the factory. A digital product key (DPK) is encrypted and installed on the motherboard BIOS during the manufacturing process. Windows 8 will be ignited automatically the first time that the computer is connected to the Internet. With systems activated by OA3, most of the computer's hardware can be replaced without the need to reactivate the software from Microsoft.

  • Guide: replace the HDD with SSD, Lenovo Y480

    Lenovo
    That's how I replaced my HDD with a SSD in my Lenovo Y480. I did it immediately, so there is no user file to consider. I used a key from Lenovo recovery. Read this guide in its entirety before starting.

    Execution time: about an hour.

    Items, you will need:

    -Y480 Lenovo

    -New SSD (I chose a Mushkin Chronos Deluxe because my research lead me to conclude that it is the best available from June 2012)

    -Small Phillips screwdriver

    -Butter knife or similar to remove the HARD drive. There is not much space for your fingers in there.

    -DVD-r blank

    Step 1

    Turn on the computer.

    Step 2

    Write the number '1' on a blank DVD-R and insert into the optical drive.

    Step 3

    Press the small button just to the right of the power button. This launches a recovery key.

    Step 4

    Follow the instructions on the screen to make restore disks. I chose the factory restore option, which required three DVD - Rs. label each disc with numbers to let you know in what order to use them later. Once it is finished, place back #1 DVD into the optical drive.

    Step 5

    Physically remove the hard drive and insert the SSD drive by following the instructions below.

    1. turn off and unplug your computer, flip upside down.
    2. remove the battery.
    3. remove the access panel by removing the two screws and slide.
    4. remove the two screws that hold the hard drive carrier.
    5 remove the hard drive by lifting upward. There is a right angle SATA adapter plugged into the hard drive. This card just came out with the hard drive.
    6 disconnect the hard drive adapter and plug it on the SSD.
    7 unscrew the hard drive bracket and screw it on the SSD.
    8 put the SSD drive in the Bay, screw the support down and replace the access panel. Be sure to screw it up.
    9. replace the battery, lock.

    Step 6

    If you did not already the first recovery DVD in the optical drive, use a paper clip to open the optical drive and insert the diskette. Close the drawer, then turn on the computer to start the restoration.

    Step 7

    Select the boot drive by pressing F12 when you see the Lenovo logo during startup, and then select the optical/DVD drive in the list.

    Step 8

    Follow the instructions on the screen. The first time that I did, restoration impossible immediately, probably because of a missing partition. However, after restarting the computer by performing a battery pull, then continue to step 6 restore completed successfully.

    I have not compared this drive, but I can tell you that the Windows experience index is 7.9 and startup time is 24 seconds now. The base index is 6.8 for this system now.

    You will find that Windows has already helped TRIM. However, regular defragmentattion was still on. I think that the system restore has been disabled automatically.

    Good luck

    Matt

    I saw no option for this, and I was quite surprised, that he didn't do it automatically. I'm not an expert on everything, so what follows is a guess.

    Perhaps that if you create a partition on the SSD first, recovery will recognize and use it.

  • Replacing hard drive with a smaller

    I'm fixing a friends G62 (G62-B27SA to be exact).

    It keeps failing hard drive tests so I'll replace the drive and restore the system with the recovery CD

    The current drive is a 500 GB WD Scorpio Blue.

    My question is - the recovery refuses to fill out if I replace the drive with:

    a / a 320GB Scorpio blue

    b / a 500 GB Toshiba.

    I'm not sure how limited the system of specific components.

    Hello:

    You can almost count on the fact that the recovery discs do not work on a hard drive smaller than that which was originally installed.

    I do not think that the brand of hard drive will also count as long as the size is not less than the original one.

    If you can still read all 25 characters of the product key of W7 on the Microsoft sticker on the bottom of the PC, and the recovery disks do not work, simply do your own installation of W7 media and allows to install W7 on any hard drive size/brand you want.

    Here's how...

    If you can read the Microsoft windows 7 25-character product key, you can download simple Windows 7 ISO files to burn on a DVD for the version of windows that is installed on your PC, and which is listed on the Microsoft COA sticker on your PC case.

    Burn the ISO with the option to burn the ISO on your DVD burning program and burn it at the slowest possible speed that will allow your program. This will create a bootable DVD.

    Or use the installation of Windows 7 USB/DVD tool to compile the ISO file that you download from Digital River. Link and instructions below. You need a 4 GB flash drive to use the USB compilation method.

    http://www.microsoftstore.com/store/msstore/HTML/pbPage.Help_Win7_usbdvd_dwnTool

    Use 25 characters on the PC product key to activate the installation.

    The key will activate a 32 or 64 bit installation.

    Then go to the support of the PC and driver page to install the drivers you need.

    Link to downloads ISO of W7 is below.

    http://www.mydigitallife.info/official-Windows-7-SP1-ISO-from-Digital-River/

  • Replacement of a special character for word files and convert docx to doc

    Hello!

    I'm developing a tool for our team. Withouth as much detail that I have to watch a lot of special characters in a Word file (docx, but I should also convert doc, but later on this topic) than these special characters with others to change.

    For example, word replaces... with a character, but other software we can't handle this character. So now I have an excel spreadsheet that has special characters in one column and those I want to replace them by in the next. One who is now a constant loop is the replacement of the... with... (with a space between the two points)

    The small tool worked very well on a test document where I just dropped in all the characters I want replaced. I tried with the doc type should be used on and it starts an infinite loop of spamming characters. I will attach a picture of the sniplet of code and an image of what it does in the document now.

    Can someone help me with this? I tried increment the range after that I found something but it does not change the problem. I can't join the VI unfortunately.

    I also convert the docx files doc files (I think that the 2007 version?) If anyone can help with this? So far, I have tried to do a macro in word and use an activex magic to copy the macro, but I hit hard walls everywhere...

    Thanks in advance!

    (And sorry, I'm new to the Forum)


  • Convert the text string into array of words

    I'm trying to convert an input string of sentence written with spaces between words in an array of strings of 1 d with one word in each element of the array.

    That's what I have so far, but his does not work as I would like.   I have trouble getting in the array to zero at the beginning of each series.

    Thank you

    Why don't you just use the String Array to worksheet and specify a space as a separator?

  • How to convert the string with numbers in the table of Boolean 2D

    Hello

    I have input a string with comma separated numbers 1,192 (starting at 1).

    This string must be converted to a table 2D-boolean. Each number that appears should be true, not true rest.

    The 2D table consists of 4 times of 0.47 Boolean values.

    1.48--> [0.47] numbers [0]
    49.96--> [0.47] numbers [1]
    Numbers 97.144--> [0.47] [2]
    145.192--> [0.47] numbers [3]

    If a '1, 49, 97 145' input string put all [0] [0.3] true.

    How can it be easy/fast resolved?

    Thanks for help

    Break the string of numbers in a table of numbers.  (Spreasheet String to Array).

    In a loop For, index with each issue of this table.  Use in the range and Coerce to see if it is in the range of numbers.  (You can put this in a loop For as auto good indexing through the ranges).  If it's in the range, then use subset replace table to activate the corresponding item in a real.  If this is not the case, do nothing.  Maintain the table of Boolean in a shift register.

    Repeat this step for each number in your table.

    (What is a class assignment?)

Maybe you are looking for

  • Skype keeps disconnecting...

    I started Skype on my laptop and after check in and all of a sudden I signed. Thought I have misclicked so signed again. Same story. Sign me out. Abandoned and passed to my PC. Exactly the same thing. I have the most recent version that is not the pr

  • Cannot access control panel

    Hello I'm trying to access the control panel and whenever I try to access the control panel it comes up with an error that Windows Explorer has stopped working and said then that reset Windows Explorer.  I stopped and restarted and that did not help.

  • AMD AHCI Compatible Raid Controller what's necessary on a desktop computer?

    Why HP includes a traid controller software in the installation and start-up of a desktop computer with a single hard drive? What purpose does it serve other which sows confusion trying to recover an accident or, failing hard drive?

  • Observed a strange behavior with PhoneListener

    Hi all 1. work on the version of BB storm (9530 Device/Simulator) is v4.7.0.75 2 opportunity BB JDE 4.7 3A signature permissions 4. the request is: PhoneListener does not have instances that was created by UIApplication, PhoneListener always creates

  • Versions of ANY SHARE a convertible esxi in figures

    Convertible versions of ALL SHARE ONE Esxi in document numbers