Flash/Flashvars & Dynamic XML
- Started
- Last post
- 9 Responses
- ********
Have a bit of a problem. I have a flash movie that loads a dynamically generated XML file using loadvars. I'm running into a bit of a problem. Code below.
flashvars:"xmlfile=xml.asp?mid...
Now the XML file gets loaded into Flash just fine and the first parameter (mid=) in the querystring is parsed no problem. The second parameter seems to get lost - I assume it has something to do with the '&' - I have read that the '&' is basically a delimeter for the flashvars used...
Any help appreciated.
- ********0
if you're doing a sendAndLoad object pair, then it must be set to POST, then just stick your vars onto it..
k=new LoadVars();
j=new LoadVars();j.onLoad = function(success){
if (success){
//do stuff with your response here...
}}
k.mid = somevalue;
k.cid = somevalue;k.sendAndLoad(xml.asp,j,POST);
so one loadvars object holds your query string parameters, and the other 'catches' the response..
HAS to be POST, though..
Other people will post after me and make it much clearer. And better.
- Boz0
cdata that url
like:
{cdata("http://some.com?var=some...
- Boz0
ah..I hate NT's url and tag parsing and the overall inability to edit your posts.
- Timson0
the ampersand shouldn't be the problem, i used it a dozen times without any problems.
example:
var update_lv = new LoadVars();
//
var xmlData = new XML();
xmlData.onLoad = loadXML;
//
update_lv.sendAndLoad("update-sh... xmlData, "POST");
- ********0
Any examples you could point me to?
- tomkat0
try html encoding that ampersand
var1=1& a m p ; var2=2
without the empty sapces
- ********0
Tried that...no joy :(
- joyride0
encode the url with hexadecimal characters and unescape it in flash to have it displayed correctly
- ********0
Fixed the problem. Just created an array in my querystring using a comma as the delimeter. All worked perfectly.