Jump to content

Using links with "&" in flash

Recommended Posts

Hi, I am building a flash website which takes it's content from text files. In these text files I use HTML links and images. I need to make a paypal button on one page. Unfotunatly the code has & in the link address, this means that when flash reaches an & it thinks the file has ended and does not load the rest as i am using the loadVars method. the text file is a s follows:

&daTextBox=<img align='left' height='150' width='170' src='pic8.jpg'>Psychotherapy is a type of Soultion<br>Second Paragraph.  Contains lots lots lots lots lots lots lots lots lots lots lots lots lots lots lots lots lots lots lots lots lots of stuff<br><img align='right' height='150' width='170' src='pic9.jpg'<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=kathleen%2ehaden%40btinternet%2ecom&item_name=1%20hour%20Reverse%20therapy%20Session%20%28Dundee%29&item_number=RTdundee&amount=100%2e00&no_shipping=0&no_note=1&currency_code=GBP&lc=GB&bn=PP%2dBuyNowBF&charset=UTF%2d8"><img src="buyit.gif"></a>&

How can i make flash ignore the & in the html link?Thanks for any advice, suggestions, etc.Ewen

Link to post
Share on other sites

I haven't ever dealt with this before but try something like \u38 as an escape char for &, but I am not sure how to use unicode escape characters in PHP/ActionScript, if you can. Try searching up Unicode Escape Characters + PHP/ActionScript on google or some search engine and that might help.Since it's such a weird problem to me, I can't really give much advice other than that.

Link to post
Share on other sites

Just to mention, Actionscript doesn't have anything to do with PHP. The escape sequence for an ampersand is %26, but that would not help in this case because you can't URL-encode the entire URL and expect to be able to reproduce it accurately. Instead you will probably want to use another character or character sequence for ampersands in the text file, and replace them after you read the value in. So instead of something like this in the file:<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=kathleen%2ehaden%40btinternet%2ecom&item_name=1you'>https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=kathleen%2ehaden%40btinternet%2ecom&item_name=1you would do something like this:<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick[::amp::]business=kathleen%2ehaden%40btinternet%2ecom[::amp::]item_name=1and then in Flash after you read the file you would replace [::amp::] with &

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...