Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: FLASH: UrlEncode actionscript.
From: Robert Bleeker
Date: Wed, 9 Feb 2000 22:35:13 GMT

Hi flashers,

While we are talking about URLencoding, I generated a short actionscript to
do it for me. I had major problems getting the GET and POST functions to
work, so I stabilised it by hard coding the URL query codes using this
actionscript.


<snip>
Comment: attach your text variable here
Set Variable: "text2Encode" = yourTextVariableHere
Set Variable: "xx" = 1
Set Variable: "partText" = ""
Loop While (xx<=Length(text2Encode))
Set Variable: "char2Check" = Ord(Substring(text2Encode, xx, 1))
If ((char2Check>63 and char2Check<91) or (char2Check>96 and char2Check<123)
or (char2Check>47 and char2Check<58) or (char2Check>43 and char2Check<47) or
(char2Check>39 and char2Check<43) or char2Check=33 or char2Check=95)
Set Variable: "partText" = partText&Chr(char2Check)
Else
Set Variable: "bitOne" = int(char2Check/16)
Set Variable: "bitTwo" = char2Check-(16*bitOne)
If (bitTwo>9)
Set Variable: "alphaBit" = bitTwo-9
Set Variable: "alphabet" = "ABCDEF"
Set Variable: "bitTwo" = Substring(alphabet, alphaBit,1)
End If
Set Variable: "partText" = partText&"%"&bitOne&bitTwo
End If
Set Variable: "xx" = xx+1
End Loop
Comment: here is the result
Set Variable: "encodedText" = partText
<snip>


Hope somebody will find it useful.


Robert


flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and The Flash Film Festival
"The World’s Premier Flash Solutions Conference and Expo"
March 27-29, Nob Hill Masonic Center, San Francisco, California

-Register before Feb 25 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  Re: FLASH: UrlEncode, Cheri Harder

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]