|
-
AKA [ Paul Bainbridge]
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.
Last edited by marexposed; 05-06-2008 at 10:16 AM.
-
AKA [ Paul Bainbridge]
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".
-
AKA [ Paul Bainbridge]
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).
-
This worked for me, except one thing
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.
Code:
movClip.getURL("http://myurl/index.php", "_blank", "POST");
THANK YOU!
 Originally Posted by toltec7
you should do that code in timeline I guess...
so name you button (instance name)
and do this on _root or some other timeline...
button.onRelease = function () {
var movClip:MovieClip = _root.createEmptyMovieClip("mov", _root.getNextHighestDepth());
movClip.picho = "hola";
movClip.getURL("http://myurl/index.php", "POST");
}
that really should work if you wanna send with POST.
you can send with GET by adding a query string like the other guy explained...
-
marexposed, It has to be _url. You are missing the underscore.
Last edited by e_tit; 04-01-2009 at 11:27 AM.
-
Bearded (M|G)od
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.
Last edited by MyFriendIsATaco; 04-01-2009 at 12:00 PM.
Reason: Typo
-
Bearded (M|G)od
 Originally Posted by x_liu
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.
Code:
movClip.getURL("http://myurl/index.php", "_blank", "POST");
THANK YOU!
You should always use some form of sendAndLoad. Using getURL is real old. To do what you want to do, you'd use almost the same exact syntax, but instead of sendAndLoad, you'd use just send. LoadVars.send().
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|