For a recent project(CLR), I was stuck because of some unassuming characters! They were very adamant and just wouldnt show up. Meet the ‘&’ character and the ‘+’ character. These guys wouldnt budge an inch from their invisible stand despite me saving the text file as ANSI or UTF-8 or Unicode. I was pulling text from a text file into a Flash textfield and these characters just couldnt tolerate it!

As usual I began the ‘googling it out’ routine and after many unsuccessfull attempts I stumbled upon this page: http://i-technica.com/whitestuff/urlencodechart.html where I found the dreaded solution! Use the htmlencode characters as follows:
& – %26
+ – %2b

Here’s a page where you can enter you content and get the required converted data in the appropriate format: http://www.dommermuth-1.com/protosite/experiments/encode/index.html

I ve finally managed to pull data from MS Access database into an ASP page and then into Flash! It wasnt difficult at all. I never tried it earlier because of many reasons that can grip a creative person. The biggest of them all is ‘laziness’!

Anyway, coming back to my MS Access to ASP to Flash trip, it was very simple. Flash needs a string in the following format:

var1=value1&var2=value2&var3=value3… etc.

Some website had posted this format with an extra ‘&’ character in the beginning which makes it:

&var1=value1&var2=value2&var3=value3…

The preceeding & is WRONG! Why do people post tutorials with unchecked examples? Anyway, the the next problem was: I was pulling an array of a list of things from the database. While writing the ASP script, I made a for loop that calculated from 0 to ubound(the_array) and then response.write (“var1=” &recordset(“name of the database field”)& “&”)

The obvious problem is, this script lands with an extra ‘&’ at the end of the string:

var1=value1&var2=value2&var3=value3&

This creates a problem for ASP and Flash! The ending ‘&’ is absolutely unnecessary. So I simply made a variable called ‘total’ and incremented the value of ubound(the_array) and stored it in total and added to the script:
response.write(“total=”&total)

Now the script outputted:
var1=value1&var2=value2&var3=value3&total=3

Then in Flash, using the LoadVars object, I grabbed the total value and added the preceding variables’ values to a combobox using:

var my_lv:LoadVars = new LoadVars();
my_lv.load(“the url of the asp page”);
my_lv.onLoad=function(success){
if(success){
for(i=0;i_root.myComboBox.addItem({data:my_lv["var"+i], label:my_lv["var"+i]});
}
}
}

Thats it!