Deleting text in a dynamic text box

Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default Deleting text in a dynamic text box

    I am trying to delete the last character entered (be it alpha or numeric) into
    a dynamic textbox (that i am populating using only buttons on a form). The
    trick is I want to use a button to delete the last character. so far my code
    for the delete button looks like

    on(release)
    var L = mytxt.length
    Selection.setFocus("mytxt")
    Selection.setSelection((L-1),L)
    mytxt.replaceSel("")


    however all this does is select the text and does not write over it. i have
    tried every other way i know of and Flash will not write a null string over an
    existing character. is there anyway to do this??

    Rogerio62 Guest

  2. Similar Questions and Discussions

    1. load external text to dynamic text field in levels
      Dear Sir I found the Tech Noe Index #16238 is useful in creating dynamically loaded text from external text file. However, the method mentioned...
    2. How to center text in dynamic HTML text field ???
      In Flash MX 2004 I suddenly find myself comletely helpless trying to align all text to the center in my dynamic text field. I dont recall running...
    3. Dynamic text fields. Continuing text over columns
      Hi I'm doing a mock up news paper article over 4 columns in flash mx and the text loads in dynamically. I have 4 dynamic text boxes sitting side...
    4. Deleting text from text boxes
      a "footer" on this document. I actually discovered this feature myself by accident the other day. In the document, click on "view" and drag down...
    5. Dynamic text in smooth scrolling text field - help
      here's links to the files. http://www.anicespot.com/test/ http://www.anicespot.com/test/easing_textScroller-01.html...
  3. #2

    Default Re: Deleting text in a dynamic text box

    when you create your dynamic text box on the flash stage, you can assign a
    variable to it (look at the properties window for VAR in flash mx). then, in
    your code, if you change that variable, the contents of the textbox will change.

    if myString is your variable, then you could do something like this

    myString = myString.substring(0, myString.length);

    or something like that....you might need to experiment.


    sneakyimp Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139