Sounds like _root.loaderInfo.url is not holding any data.
What are you expecting to see?
Can you post your fla?
Got to get to the bottom of this.
Printable View
Sounds like _root.loaderInfo.url is not holding any data.
What are you expecting to see?
Can you post your fla?
Got to get to the bottom of this.
Ok, I tried the LoadVars. I wouldn't quite know where to place the code, as it isn't as evident as an event handler. I just deleted the code in my previous event handler and placed the code somewhere that reads "link : Frame 1". The code goes:
var picho:String;
botonurl.onRelease = function() {
picho = _root.loaderInfo.url;
sendVar(picho);
};
function sendVar(param) {
lv = new LoadVars();
lv.picho = param;
lv.sendAndLoad("http://myweb/index.php",lv,"POST");
lv.onLoad = function() {
tracer.text = this.varReceived;
};
};
This doesn't even open a popup (nor no-popup) window with http://myweb.
What is it your trying to do with the variables being passed?
webdreamer I'm expecting to see the address of the webpage which has loaded the swf and is playing it.
Let's say you have 2 webpages http://webA, http://webB, loading the same swf from a third host. I need the swf, on click, to say "I'm playing on a browser navigating webA" or "I'm playing on a browser navigating webB".
I dont see a problem. i have it working here
code:
but1.onRelease = function() {
trace("clicked one_btn");
trace(this._url);
getURL("http://www.scotflash.co.uk/test/index.php?urlVar="+this._url);
};
Yes webdreamer, but this._url refers to the address where the swf is hosted, not the address of the container. I'm looking for the address of the container (http://webA or http://webB).
I was having similar problem, except that I NEED to get the data in POST method to prefill another webform. toltec7's code worked miracle for me, only thing I needed to change is adding "_blank" in the getURL call.
THANK YOU!Code:movClip.getURL("http://myurl/index.php", "_blank", "POST");
marexposed, It has to be _url. You are missing the underscore.
It's impossible to retrieve the url that the swf is embedded on without some Javascript trickery. And it'll only work if the swf is embedded with the "allowscriptaccess" variable set to "always".PHP Code:import flash.external.ExternalInterface;
var r:String = ExternalInterface.call("function(){return window.location.href}");
trace(r); //r will be exactly what it says in the browser's address bar.