Getting variable from URL

I have this sliding gallery swf that loads the thumbs from a xml file. But I would like it to load a different xml file depending on a variable in the browser URL. For example if viewpics.php?category=cars, I want the swf to load cars.xml

Thanks for any help :b:

Ok man, I’m a noob but I’m gonna try to help here. One way I found was to parse that string since I can’t find a way to query it(like in asp). myString.substring(from, to); may allow you to grab that ā€˜cars’ string and concatenate it into your load swf command. Take a look here for the details http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary698.html From would obviously be where the = sign is and to would be string.length I hope this helps, let me know if you find a better way.

Hey Justin, thanks for the reply. I was browsing around and found this info:
…

the easiest way would be to use ASP or PHP and pass the variables by appending it to the end of the url like this:

http://www.domain.com/page.asp?frame=15

then you would put this code at the top of your ASP page:

<%
dim frame
frame=Request.QueryString(ā€œframeā€)
%>

then you would pass the variable and value to the SWF in the object and embed tags…

you would just put the below code after the ā€œ.swfā€ in the object parameter(<param>) and in the embed part as well…

?frame=<%= frame %>

example:

<param name=ā€œmovieā€ value=ā€œmovie.swf?frame=<%= frame %>ā€>

then you would just reference the variable by using ā€œ_root.frameā€ and the value of 15 will be passed to the movie…

…

I tried it and it works great, pretty easy to do.

Cool Thanks! I’m pretty good with ASP, just never passed anything from ASP to flash. I’ll keep this one in my list of tools.