A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: getURL(problem)

  1. #1
    Senior Member
    Join Date
    Jul 2002
    Location
    New Mexico
    Posts
    101

    getURL(problem)

    I have a large dynamic text that is formated inside of flash (new lines, bold text ect).

    I am trying to post that information to a website using geturl(). Is there any way to make newlines in a posted url??

    I can have the dynamic text posted either as html or plain text (it is formated and displayed in flash as html) however, If I post the html, the browser reads the varriables as html and displays all the html tags. If I post it as plain text, it displays one long string.

    the posted variables are being handled via php.
    Beyond Flash
    Your one stop web shop
    http://www.beyondflash.net

  2. #2
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,317
    try using <br> or newline
    .: To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Twitter - Linkedin
    bringmadeleinehome.com

  3. #3
    Junior Member
    Join Date
    Aug 2004
    Posts
    20
    The problem stems from how the URL is parsed by the webserver... I ran into a similar problem doing long SQL statements ina URL to be parsed by a cgiscript... someone sent me this list of codes to replace characters that the webserver can't deal with:

    For example:
    Code:
    (hello world) would be %28hello%20world%29
    Code:
    Character     Replace With
      =                    %3D
      '                    %27
      (                    %28
      )                    %29
      space                %20
    Unfortunately I don't have a newline character - just what you see here, but maybe it will give you enough to search the web for a more complete list...

    Sorry I couldn't be more help...

    -DM
    Last edited by digitalmechanic; 06-26-2005 at 01:48 PM.

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    if you see html cides on a website, probably something is changing the < > into &lt; and &gt;
    if you accept plaintext from flash, line returns are of the \r variety - you may want to str_replace them into \n in your php script:
    $text = str_replace("\r", "\n", $text);

    Musicman

  5. #5
    Junior Member
    Join Date
    Aug 2004
    Posts
    20
    I may have misunderstood the problem, but I thought the idea was to pass a URL that contains additional information using getURL() - In other words a text string that would work if you dumped it in the "Address" bar of your browser...

    Does the \x notation work in a URL? I know the &xxx and the hex characters work...

    There's a whole list of acceptable characters in the HTML Master Reference (IDG Books) in Appendix C...

    -DM

  6. #6
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    the idea is correct, and some variations take care of the encoding for you:
    getURL with the variable in the same timeline and GET option
    loadvars.send with the variable specified amd GET option.
    Adding the string yourself means that you need to escape it before (this will use the %26 etc codes)

    Your php will automatically decode this. After that (in your php) you can change line endings the way you want them.

    Musicman

  7. #7
    Senior Member
    Join Date
    Nov 2000
    Location
    Manchester, UK
    Posts
    454
    I've used an actionscript function in the past to urlencode text passing to and from external data sources -I think I originally found it on flashkit!
    I'm not 100% clear now as the fla file is at home 30 miles away but i seem to remember its something like this

    Using html enabled input area called "MyTextfield" and
    Variable to send called "varToSend"

    when making the GEt or POST url call format the string using

    varToSend = encode(MyTextfield);

    And to redisplay URLencoded input from server / external source use

    MyTextfield = decode(varReceived);

    Try checking them in an AS dictionary - but as far as I can remember thats it.
    P.S.
    Wouldn't life be easy if Keyboards had a "Make It So" button?
    It could sit next to the "Any" key!!

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