flashVars&dynamicURLs
- Started
- Last post
- 7 Responses
- nameless
i am importing variables from an asp script, and running into problems trying to import a dynamic URL...
myVarName=variable&myVarURLname...
flash is reading the second & as the next variable to import. I tried using the & character code to no avail. can anyone recomend an option besided writing a script to concecat the broken up url in flash?
- nameless0
Should i be bringing the data into flash through another channel? like XML?
anyone?
- unfittoprint0
Hello.
When I want o retrieve some var from PHP, I use the new LoadVars object in Flash MX. It sends the request to the script, and retrieves without having a URL with a variable on it.
Some variables (and that's because the text was in portuguese) had to be scripted using a UTF-8 envcoding, but I don't think that's the case. Anyway the thing goes like this:
myVars = new LoadVars();
MyVars.onLoad=function(){
if(sucess){
myText = this.var1
}else{
trace("Noooooooooooo!!")
}
};myVars.load("fetch.php?type=name...
//good luck!
- Cadillac0
Did you try escaping the ampersand with a backslash?
Like so:
myVarName=variable&myVarU
RLname=www.foo.com&bar=10
0
- nameless0
just tried escaping the & with forward and backslashes, to no avail.
unfit... the variable i am returning IS a URL which has the abilty to contain & and =. can anyone else out there clue me in on how i can do this? perferably with a mod to the simple solution i have going verses something else like XML, but any solution would be welcome!
- jh0
should be easy enough to concat the two variables together. var myUrl="http://www.yourlocation";
var myRestOfUrl=".com";
var myNewURL=myUrl+myRestOfUrl;
which works for me - email me if your still stuck!!
- nameless0
its not that exactly...
the variables/URLs are coming from a database which is updated by the client from an ASP script, so the URLS will never be the same, in that they link any given site with an & in it and the link does not work...so the concat would have to be very much more complexe, waiting for my specific variable names between URLs and sandwiching that together. it would be a serious and wasted pain to write that script just as a work around to a problem there must be a real solution too. thanks anyway jh.
suppose i will just go with XML.
- nameless0
thought i would bring this thread back to close it out for anyone searching...
i couldnt find the answer so i ended up doing it in XML.