Using an ampersand in ActionScript loadVariables function...

So I'm working on a project for Sky, its 1 hour to the deadline , and I think I better test the links which I am importing into the Flash project (for deployment on the Desktop as a Projector) from a txt file using the loadVariables function... This links look something like this:

http://www.blahdeblahdeblah.com/something.php?this=123&that-123&p=theURLiamtryingtolinkto   (note the ampersands in there)

...and thats it! Everything is shot to hell because of the ampersands. When Flash imports using loadVariables it wants everything in a standard MIME format application/x-www-form-urlencoded (a standard format used by CGI scripts). This means variables are seperated by ampersands. For example:

company=Adobe&address=601+Townsend&city=San+Francisco&zip=94103

So as soon as you stick an & midway through a URL in Flash thinks its come to the end of the variable and ignores the rest of the URL. Fine! I thought (at first)... I'll replace the URL with &... You see the irony there?

I furiously started hard coding the URLs and in doing so came across a way of replacing the & with its URL character code... Its so simple it hardly warrents writing all of this. Simply swap out all ampersands with %26. Its as easy as that! So:

http://www.blahdeblahdeblah.com/something.php?this=123%26that-123%26p=theURLiamtryingtolinkto

Works a treat!

And in case you were wondering here's a list of other URL encoded characters:

URL Encoded Characters

backspace %08
tab %09
linefeed %0A
creturn %0D
space %20
! %21
" %22
# %23
$ %24
% %25
& %26
' %27
( %28
) %29
* %2A
+ %2B
, %2C
- %2D
. %2E
/ %2F
0 %30
1 %31
2 %32
3 %33
4 %34
5 %35
6 %36
7 %37
8 %38
9 %39
: %3A
; %3B
< %3C
= %3D
> %3E
? %3F
@ %40
A %41
B %42
C %43
D %44
E %45
F %46
G %47
H %48
I %49
J %4A
K %4B
L %4C
M %4D
N %4E
O %4F
P %50
Q %51
R %52
S %53
T %54
U %55
V %56
W %57
X %58
Y %59
Z %5A
[ %5B
\ %5C
] %5D
^ %5E
_ %5F
` %60
a %61
b %62
c %63
d %64
e %65
f %66
g %67
h %68
i %69
j %6A
k %6B
l %6C
m %6D
n %6E
o %6F
p %70
q %71
r %72
s %73
t %74
u %75
v %76
w %77
x %78
y %79
z %7A
{ %7B
| %7C
} %7D
~ %7E
¢ %A2
£ %A3
¥ %A5
| %A6
§ %A7
« %AB
¬ %AC
¯ %AD
º %B0
± %B1
ª %B2
, %B4
µ %B5
» %BB
¼ %BC
½ %BD
¿ %BF
À %C0
Á %C1
 %C2
à %C3
Ä %C4
Å %C5
Æ %C6
Ç %C7
È %C8
É %C9
Ê %CA
Ë %CB
Ì %CC
Í %CD
Î %CE
Ï %CF
Ð %D0
Ñ %D1
Ò %D2
Ó %D3
Ô %D4
Õ %D5
Ö %D6
Ø %D8
Ù %D9
Ú %DA
Û %DB
Ü %DC
Ý %DD
Þ %DE
ß %DF
à %E0
á %E1
â %E2
ã %E3
ä %E4
å %E5
æ %E6
ç %E7
è %E8
é %E9
ê %EA
ë %EB
ì %EC
í %ED
î %EE
ï %EF
ð %F0
ñ %F1
ò %F2
ó %F3
ô %F4
õ %F5
ö %F6
÷ %F7
ø %F8
ù %F9
ú %FA
û %FB
ü %FC
ý %FD
þ %FE
ÿ %FF

Comments

pingback

Pingback from endyear2012.com

auto glass repair «  End Year 2012

Posted on May 4, 2010 23:11 by endyear2012.com

Ali Landrus

Well, here is my blog.

Posted on May 25, 2010 02:22 by Ali Landrus

Damon Pongkhamsing

Great post, here is my blog.

Posted on May 25, 2010 04:34 by Damon Pongkhamsing

Teodora Noriego

Hi,I'm a professional pianist and I've made a stupid rule that enables me to take a 15 min break each 1 hour of practicing. Now, every break I've to complete some thing completely different, so mostly I go to Google and seek for that recommended last hour web site. It can be enjoyable to complete something different and to discover about new points every and each day. BTW, now I'm playing. Mozart. Your site is fantastic, I wish I could stay longer, but I've to get back to play... Following time I'll occur to visit again.

Posted on May 31, 2010 02:51 by Teodora Noriego

web traffic

The USA Department of Defense allegedly just told major USA web service providers to allow Defense to protect their operations from cyber attack and that the Internet is a huge national security risk. The story is from Wired - www.wired.com/.../einstein-on-private-networks. Okay so maybe it's just me but this seems like it might be rather important news... like everybody who uses or does business on the Internet might see the plug get pulled one day? This seems pretty unlikely to me -- exceptionally unlikely as a matter of fact -- but I think those of us who use the Net should talk about this sort of thing... spread the info so that we're all aware. Not paranoid but aware. Might not lead to anything then again maybe it could... Tighter networks maybe.

Posted on June 8, 2010 11:06 by web traffic

Ozie Reuss

Spectacular article, a great deal of helpful information and facts.

Posted on June 16, 2010 06:06 by Ozie Reuss

Melida Bourget

Impressive article, a great deal of practical information and facts.

Posted on June 18, 2010 20:06 by Melida Bourget

Zachery Dk

Magnificent blog post, a great deal of valuable information and facts.

Posted on June 20, 2010 06:26 by Zachery Dk

Kris Allor

This is the second moment I've encountered your blog post in the last couple weeks.  Seems as if I ought to bookmark it.

Posted on June 20, 2010 11:02 by Kris Allor

Homeopathic Tinnitus Remedies

Here is the 2nd moment I've noticed your web sites within the last few weeks.  Seems like I ought to bookmark it.

Posted on June 22, 2010 03:47 by Homeopathic Tinnitus Remedies

Bacterial Vaginosis Natural Cure

Quite interesting article.  Your current internet site is rather quickly turning out to be among my top picks.

Posted on June 23, 2010 08:37 by Bacterial Vaginosis Natural Cure

Bacterial Vaginosis Natural Cure

Here is the 2nd time I've run into your webblog in the last couple weeks.  Looks like I ought to bookmark it.

Posted on June 23, 2010 08:37 by Bacterial Vaginosis Natural Cure

Bacterial Vaginosis Natural Cure

Awesome article, plenty of practical knowledge.

Posted on June 26, 2010 01:36 by Bacterial Vaginosis Natural Cure

Fetal Doppler Hire

Remember to maintain posting together with fantastic blogposts just like it. Relating to lined up marked your web blog along with am gonna e-mail it to some number of buddies of my verizon prepaid phone that will I'm sure would certainly like looking at

Posted on July 9, 2010 07:42 by Fetal Doppler Hire

Laptops Under $500

I was searching for articles about this on Google and stumbled on your item. I found it to be very useful. Thanks

Posted on July 12, 2010 15:42 by Laptops Under $500

Gaylord Louderback

I had a blog like this once, but it got spammed so bad I had to close it. You appear to have a better spam filter! Kudos!

Posted on July 12, 2010 20:27 by Gaylord Louderback

Amos Gucman

I came across this topic on a different site and couldn't fully see the implications, but your post makes it clearer to me now. Many thanks!

Posted on July 12, 2010 20:28 by Amos Gucman

Dewey Helphenstine

I came across a link to your web site on a Forex trading site, and I should say... Your site is tons better. You explain it more clearly, thanks

Posted on July 12, 2010 23:22 by Dewey Helphenstine

Ambulance Service

I stumbled on a link to your site on a Forex website, and I should say... Your web site is a lot better. You explain it more clearly, thanks

Posted on July 14, 2010 03:52 by Ambulance Service

Online Chat

I was looking out for information about this on Bing and stumbled on your piece. I found it to be really useful. Thanks

Posted on July 14, 2010 03:52 by Online Chat

HDTV on PC

I used to have a site about this topic, but I got so much spam I had to shut it. You appear to be better at weeding out the spam! Kudos!

Posted on July 14, 2010 06:40 by HDTV on PC

platinum diamond rings

I was looking for articles about this on Yahoo and came upon your piece. I found it to be really useful. Thanks

Posted on July 15, 2010 19:51 by platinum diamond rings

platinum diamond rings

I watched a program concerning this on TV last night. Thanks for explaining it more thoroughly

Posted on July 15, 2010 19:51 by platinum diamond rings

platinum diamond rings

Odd... I just came across your web site by searching for 'financial spreadbetting' on Yahoo. But I haven't found any articles about that on here?

Posted on July 15, 2010 22:45 by platinum diamond rings

dragon oath gold

This is my First visit to this blog. We are starting a new initiative in the same niche as this blog. Your blog provided us with important information to work with. You have done a fantastic job. The finnish clinic he went to for surgery is world renowned for their new techniques using platelette rich blood to both speed up and improve the healing process, so injuries that used to be career threatening are now considered routine.

Posted on July 26, 2010 13:21 by dragon oath gold

kingdom heroes gold

Took me time to read everything, but I really enjoyed it. It proved to be Very helpful to me and I am sure to all the other visitors here! It's always nice when you can not only be informed, but also entertained! Thanks again...

Posted on July 26, 2010 15:15 by kingdom heroes gold

Boi Gold

Right after looking through this article, I pondered exactly the same thing that i often wonder when checking out fresh blogs. What do I think about it? Exactly how does it influence me personally? I am really thankful for the weblog and how it's developed the internet right into a enormous collection of propagated ideas. Surprisingly, Yahoo brought me here when i was working away at conditioning and medical research. Glad that I stayed around and I will make sure to add your details to my book marks so i can revisit down the road. Bye!

Posted on July 26, 2010 15:36 by Boi Gold

buy c9 gold

I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.

Posted on July 26, 2010 15:53 by buy c9 gold

cabal alz

Advantageously, the article is really the best on this notable topic. I harmonise with your conclusions and will thirstily look forward to your approaching updates. Saying thanks will not just be adequate, for the tremendous clarity in your writing. I will directly grab your rss feed to stay privy of any updates. Authentic work and much success in your business enterprize! The recipe itself calls for a number of different ingredients, but there's nothing too complex about it.

Posted on July 26, 2010 16:15 by cabal alz

Martial Empires gold

Nice blog, It made a good read, You write great articles which made good reading .I will come back and read some more of your blogs, passes the day, I found your blog on yahoo Keep up the excellent work !

Posted on July 26, 2010 16:32 by Martial Empires gold

rom gold

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon.

Posted on July 26, 2010 16:41 by rom gold

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading