views:

986

answers:

2

How can you get and set the hash or anchor part of an URL in pure Actionscript? When googling for a solution I've found explainations for doing it using JavaScript, but is it possible to get it without using JavaScript? (I'm using Actionscript 2, I may consider updating the code to AS 3, but it doesn't seem to be a quite straight forward process.)

+5  A: 

What you want is SWFAdress, it's a small library that let's you modify that part of the url from flash (via a javascript)

grapefrukt
It's probably useful, but it is based on JavaScript. I wanted to know if it is possible at all to do this without JavaScript, but I'm starting to beleave it's not.
Stein G. Strindhaug
You will always need javascript.
moritzstefaner
A: 

If you ever make it to actionscript3 you could use the com.adobe.net.URI class. It exposes a URI::fragment getter/setter which looks to be exactly what you need.

Pete Hodgson
SWFAddress is the tool for the job. Anything else is simply .. unnecessary. SWFAddress is available for AS2 or AS3 so you never have to write your own.
Jenko