Skip to main content
Participant
April 4, 2011
Question

How to get the URL data?

  • April 4, 2011
  • 3 replies
  • 512 views

Hi all,

May be it is obvious but i did not find a way to do this thing :

I have got a site based on a CMS, and the address of each page are like this one :

http://www.myweb.com/index.php?option=com_content&view=category&id=31

This page have an article which a swf in it.

I was to get the URL data in my SWF. So i can do some operations. For example i want to get the value of the id (31 in this case) and put it in a SWF variables.

How do you to do that in action script 3 ?

Thanks for help.

This topic has been closed for replies.

3 replies

Participant
April 5, 2011

I found the solution. I did it with javascript and actionscript

javascript :

<script language="JavaScript">
function recup_idtuto()
{
a=unescape(window.location.search.substr(1)).split("&");
return (a);
}
</script>

action script :

var str:String = ExternalInterface.call("recup_idtuto");

I then do some text operations on str in order to extract the ID that was in the URL parameters

April 5, 2011

try:

Compose the OBJECT tag with php add the parameters to the swf like (note: I dont know php)

....

"<PARAM NAME=movie VALUE='flaMovie.swf?id=".$_GET["id"]."'>"

........

and then in Flash:

trace(loaderInfo.parameters.id);

Lee_Burrows
Participating Frequently
April 5, 2011

hi

do a search for flashvars