all groups > macromedia flash flash remoting > june 2004 >
You're in the

macromedia flash flash remoting

group:

Passing data question mark


Passing data question mark GeezerButler
6/2/2004 4:51:15 PM
macromedia flash flash remoting:
Here's the problem, this actionscript won't pass names to the URL string

getURL(_root.UnitStr+"/detail.asp?unitStr="+names);

but when i take out the questionmark

getURL(_root.UnitStr+"/detail.asp_unitStr="+names);

there's no problem passing the variable.

I'd be really grateful if anyone knows a workaround or why this is happening.

Thanks and all the best
Re: Passing data question mark silkpuppet
6/4/2004 5:24:50 PM
I think I had that problem before too. What I did as a work around was to set
up a javaScript function in the HTML. So, in your case it might be something
like:

<script language="javaScript">
function gotoPage(url, parameters) {
document.location.href = url + "?" + parameters;
}
</script>

Then, in flash, your getURL call would look like this:

var myURL = _root.UnitStr + "/detail.asp";
var myProps = "unitStr=" + names;
getURL("javascript:gotoPage('" + myURL + "', '" + myProps + "')");

Note the use of single quotes inside the double quotes of the getURL
parameter. The getURL parameter should look something like this once it's
concatenated: "javaScript:gotoPage('http://somewhere.com',
'unitStr=someName')". You use single quotes to tell javaScript which parameters
are strings; you use double quotes to tell flash the whole thing is a string...
if that makes any sense.

~j.


AddThis Social Bookmark Button