Pull information from URL

I need to pull

[color=#003399]id = 99;[/color]
[color=#003399]code = d02d;[/color]
[color=#003399]pass = 32422;[/color]
[color=#003399]user = bob;[/color]
[color=#003399]info from a url ie:[/color]
[color=#003399]I would imagine pulling it into a array and cutting it up, however thats beyond me.[/color]
[color=#003399]If anyone could help with this, or point me towards a snipt of code I could modify it would be much appreciated.[/color]

To my knowledge, you would have to use javascript to deliver that info into flash, because I don’t think that flash has any way to check the URL for variables.

You can also have a php script write a text file and load that, etc. etc., there are some workarounds.

Read this,



Thanks for that…

The php script ?

if I load a .php file I can get the URL easy enough using

$userid = $_REQUEST[‘id’];

Problem is I can’t pass that to flash from the .php
If I try to print that the out put goes to the browser and not passed to Flash.

Is there a PHP command that will get the current URL of a HTML page you are on ?

I don’t agree with what was said ealier, I think they are automatically avialable inside flashes root, just refer to user or whatever variable and it automatically returns the variable :slight_smile:

Hmmmm ya lost me bombing

As for this

I don’t think that flash has any way to check the URL for variables.

It would have to be cut up and put into and array, and then pull out each bit and assign it to a var.

However that is beyond me… and from what I can tell Flash will only return the URL to the Flash .swf NOT the url in the address bar. :frowning:

There must be a way to call on PHP from a HTML page to grab the current URL in the address bar…

this is the code to parse:

mystring = “http://www.somesite.com?var1=testing&var2=again”;
myLoadVars = new LoadVars();
for(j in myLoadVars){

you can adapt that if you can get bombingpixels idea to work, but I have never heard of how to access url variables in _root. If anybody knows how that is done, please let us know.


absolutePath = _root._url;
splitPath = absolutePath.split("/");
folder = splitPath[splitPath.length-1];

Thats some code I was given a few months ago… however that will only return the URL of the .swf

hence this may be in the address bar

but it will only return

I found this… so I am going to see if I can get it to work…

Write a action in your Flash Movie such as :


and in the HTML Page in which this Flash Movie is emebed write a Javascript function such as:

function getHTMLURL()
alert("HTML URL is : " + document.URL);

just try tracing(userid) in your file, let me make you an example real fast…


my only code is: test.text=id;

So how are you getting id=30 into flash ?

Right now I am working on some java script…

function doPassVar(args){
	var sendText = args.value;
	window.document.myFlash.SetVariable("myVar", sendText);
function getHTMLURL(){
     alert("HTML URL is : " + document.URL);

I was just trying to work out how to combine those to functions, which would pass the entire URL to flash… I would then still have to break it up…

You did it but I dont know how…

I tried entering a different number other than 30 and it worked…

Do tell :smiley:

I have spent the last 3-4 hours searching google, I had just found you can pass variables with java and so was looking into that.

I told you, just make a textfield with the name test and put in the code :wink:

I mean the code that I gave you above, the one that looked like: test.text=id;

I did that…

But I tried it in the .html file I had…

it needs to be the .swf in the URL

Sweet… once again something so simple has me going around in circles…

If you keep saving me I am gonna have to put you on the pay roll :smiley:

what do you mean? when you call the swf from the html it no longer works?

Nope it doesn’t work from the html…

Which is killing me now cause that means I have no control over size…


look at the source code, iit uses the same fla, you can change it to .fla to see the fla too, everything’s uploaded :slight_smile:

Where is 5214

I see its not in the .fla

but it is not in the url either ?

I see where you have it… but that wont help me there…

It will be coming from a e-mail account vailidation…

I wont know what the:
code (md5 encryption)

is… :frowning:

Looks like its back to the Java function… and then the dam split()

OOP’s… lucky I posted the Java, I closed the file I was working on and didn’t save it… and I would hate to try and find it again… About time I got lucky :slight_smile: