A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [RESOLVED] How to delete the last letter of the word acs2

  1. #1
    Senior Member
    Join Date
    May 2016
    Posts
    451

    resolved [RESOLVED] How to delete the last letter of the word acs2

    hello
    How to delete the last letter in acs2

    PHP Code:
    var myListener:Object=new Object();
    myListener.onKeyUp=functions(){
    if (
    Key.getCode() == 65) {   // a
    t.text =t.text+"a";}
    if (
    Key.getCode() == 66) {  // b
    t.text =t.text+"b";}
    if (
    Key.getCode() == 8) {  // backspace
    // i need code to delete the last letter 
    }}
    Key.addListener(myListener);


  2. #2
    Senior Member
    Join Date
    Feb 2005
    Posts
    1,834
    This should probably do it:
    t.text.substr(0, t.text.length-1)
    Something like this.
    .

  3. #3
    Senior Member
    Join Date
    May 2016
    Posts
    451
    sorry my friend
    not working

  4. #4
    Senior Member
    Join Date
    May 2016
    Posts
    451
    thans swak,
    I found the solution


    PHP Code:
    t.text=t.text.substring(0t.text.length-1

  5. #5
    Senior Member
    Join Date
    May 2016
    Posts
    451
    Quote Originally Posted by kofa View Post
    thanks swak,
    I found the solution


    PHP Code:
    t.text=t.text.substring(0t.text.length-1
    thank you swaaaaaaaaaaaaaak

  6. #6
    Senior Member
    Join Date
    Feb 2005
    Posts
    1,834
    No problem. Have fun!
    .

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center