Groups | Blog | Home
all groups > flash actionscript > february 2004 >

flash actionscript : page URL


Andy Petroski
2/28/2004 7:01:59 PM
How can I get the URL of the HTML/ASP page that the Flash movie is embedded
in?

I want to get the URL string which will include a variable. Based on that
variable the Flash movie will display the correct info.

I want to use one Flash movie for all six categories/pages.

Thanks for any help.

pazzoboy
2/29/2004 2:45:40 AM
Hmm...never tried it, but I wonder if this might work on the main timeline:

Pea
2/29/2004 2:56:15 AM
Perhaps the easiest way is to pass a variable in to the swf file when it is
embedded in the page. For example....

<PARAM NAME=movie VALUE="myMovie.swf?category=1">

On another page, this could be:

<PARAM NAME=movie VALUE="myMovie.swf?category=2">

etc...

This variable, 'category', is available within the movie.

I hope it helps,
Pea

p.s. You will also need to add the category variable to the EMBED tag as
well...
Laiverd.COM
2/29/2004 4:27:03 AM
Using the _url property you can get the path to the swf file. If you need
the page; either pass it on through serverside script or through javascript.
Using javascript, this might work:

<script language = 'JavaScript'> type="text/javascript"
loc = window.document.location;

</script>

and then use document.write(loc); in the Object and embed tags to write it
as a value of a FlashVars.

John

--
----------------------------------------------------------------------------
-----------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
----------------------------------------------------------------------------
-----------
TUTORIALS at
www.laiverd.com
Flash & PHP Emailform
Using textfiles in Flash
----------------------------------------------------------------------------
-----------

AddThis Social Bookmark Button