A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: input boxes - problems

  1. #1
    if you go first
    Join Date
    Oct 2005
    Location
    Herts, UK
    Posts
    62

    input boxes - problems

    Hey,

    If anyone could help me with these two things, I'd be very grateful.

    Firstly, the arrow keys don't work for navigating around the text as the user inputs the text. Anyone know what's happening here?

    Secondly, the line-breaks are getting lost. My variables are: textBox1 and textBox2 and I am passing them to a pop-up by the following script:

    getURL
    ("javascript:window.open('dataSubmit.php?textArray 1="+textArray1+"&textArray2="+textArray2+"&active= "+active+"','popped','width=300,height=200,top='+( (screen.height/2)-100),left='+((screen.width/2)-150)+',toolbar=no,scrollbars=no,resizable=no,menub ar=no,status=no,directories=no,location=no'); void(0);");


    I have tried: textArray1 = textBox1.split("\n"); also, but this isn't working. Can anyone suggest anything?

    ps - putting "GET" at the end seems to stop the pop-up from working.


  2. #2
    if you go first
    Join Date
    Oct 2005
    Location
    Herts, UK
    Posts
    62
    Hey,

    I've sorted it. Here's what I did in case anyone has similar problems:

    1. The arrow keys didn't navigate around the text because I had a button with on(keyPress <arrow?>) which overrid it.

    2. The line breaks are stored in Flash as "\r", not "\n" as I previously though. So this bit of code replaces "\r" with "<br>":

    textArray1 = text1.split("\r");
    textArray2 = text2.split("\r");
    text1 = "";
    text2 = "";
    for (var i = 0; i<textArray1.length; i++) {
    text1 += textArray1[i]+"<br>";
    }
    for (var i = 0; i<textArray2.length; i++) {
    text2 += textArray2[i]+"<br>";
    }

    Hope this helps anyone in similar difficulty.

    -Chris

  3. #3
    It's a long way to the middle launchpad67's Avatar
    Join Date
    Oct 2004
    Location
    Prescott, Arizona
    Posts
    1,387
    Yep, that's how you do it! Nice work Chris.

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